From nobody Sat May 18 10:57:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684405162; cv=none; d=zohomail.com; s=zohoarc; b=HLDLhdJI7Ug8oMqAP31OKP540kPji2c87bbr/gKR3kpxyhzgib82P88yuWK+UlNF1TLwediKKMd/SAWXDq5KdAzctlPbJvikze5ui8WJxvR1xHdqIcveoAzcUlRSAYJt/vTeXAwCsfP5JFs1N9lP+vgxljsuBFYm55n+geXCw/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684405162; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bBojB1HHhw9e5Mqc9sqoqRl9uNsGGM3YqDRyz7NIFJw=; b=g/XQ2eWQEy4AcAh3zDS+4f10j4s9rSBCE7oH2d7nVrKQhBE9lca2QbDQOyAjTMIGmFAp3ep3rNiwL35zsX/Q5d7X0i1f9McIFC5DbbUhNpC4+Hg/XQAQWQKDBVNdP242a1N+BakmPAHPl6oxQ/KPhZBxtM+bqb7XgJ796RqP/Ww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684405162011870.3720142992722; Thu, 18 May 2023 03:19:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzai7-0007CX-2l; Thu, 18 May 2023 06:18:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai5-0007Bn-43 for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai3-0004lK-Nt for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:12 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-oF4AHTqNN62mKH4un8UJPw-1; Thu, 18 May 2023 06:18:09 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9662960d1e4so206448466b.1 for ; Thu, 18 May 2023 03:18:09 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id lt1-20020a170906fa8100b0096efd44dbffsm764745ejb.105.2023.05.18.03.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 03:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684405091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bBojB1HHhw9e5Mqc9sqoqRl9uNsGGM3YqDRyz7NIFJw=; b=K+YXBWoA8nar+BsKRpdwyrZrAmt6As/dt9bUI4OMA5DvkXyzGOZawpbaRrmLPs7LjdUne1 zfFczbkqTf+EqtOnIP1VJKMfDcjLGRDuUXEew5QYhIYvRlfHXhRn670ybUqKaig9W9SwCV odGH1dY++OExpW3RNALrDHOUVnX05to= X-MC-Unique: oF4AHTqNN62mKH4un8UJPw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684405088; x=1686997088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bBojB1HHhw9e5Mqc9sqoqRl9uNsGGM3YqDRyz7NIFJw=; b=Pu8pJHLIC4yQrZMZymc4dTWUDdRReC9M7mYNqbnSAhC0HjavObhXzGMbybytc2pho7 8zQNP+HIBJanHq8WTafAQSKA/as6v/VhJZIU/c5mnJsN4F0Iq9T4RpNPyXAWbr53O23b swaJsl31p1t+lFeVjebLmiYD1LLS2OwjeMR9RYmpKdZmTHPeGfd9wipP5J2It89KDT8y a9Rq/+YgHTY2zt9D0zH11QNjMlHOQhw8XilZ7qyxaBrl+QOF0vPJYBXYBpHFvpCh16j8 7CsLKPbkxhNVDbAkPuv9vvJ8evEFgFzozDQ9MPeePPoP2MuXeZUfeMdMXAyNz0jbElxo Ya4w== X-Gm-Message-State: AC+VfDw/CX6Hgq7Om4y5kVVraHGOhAkJ33XSqX5k21s183WOeCnvf2Ch gJt+UQgE3lkxU1Jk14muhMELOy6WjZrlXEPXaCG32LKXiobTG5xVcuwUvko3YP8OgEgc1MVXj3R AAe530TpVWg1PIsokdA7lDvu5Hrm6OfE7OnV/wkZkrrWjmfWlmmF/ie4rvmPcTJUwG30ERdfrSn Q= X-Received: by 2002:a17:907:a46:b0:94f:2b80:f3b4 with SMTP id be6-20020a1709070a4600b0094f2b80f3b4mr36915825ejc.69.1684405088077; Thu, 18 May 2023 03:18:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ544H4ISYWnS5WDZnizp1bVKCxiMEpPhIocYU9tncvGHfsa/6BROTQZcXfywILF+zMZ/v3g0Q== X-Received: by 2002:a17:907:a46:b0:94f:2b80:f3b4 with SMTP id be6-20020a1709070a4600b0094f2b80f3b4mr36915807ejc.69.1684405087741; Thu, 18 May 2023 03:18:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: armbru@redhat.com Subject: [PATCH 1/4] monitor: use QEMU_LOCK_GUARD a bit more Date: Thu, 18 May 2023 12:18:01 +0200 Message-Id: <20230518101804.992085-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518101804.992085-1-pbonzini@redhat.com> References: <20230518101804.992085-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684405162301100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Markus Armbruster Reviewed-by: Richard Henderson --- monitor/monitor.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor/monitor.c b/monitor/monitor.c index 602535696c59..4b11bca2a21d 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -161,10 +161,9 @@ static gboolean monitor_unblocked(void *do_not_use, GI= OCondition cond, { Monitor *mon =3D opaque; =20 - qemu_mutex_lock(&mon->mon_lock); + QEMU_LOCK_GUARD(&mon->mon_lock); mon->out_watch =3D 0; monitor_flush_locked(mon); - qemu_mutex_unlock(&mon->mon_lock); return FALSE; } =20 @@ -203,9 +202,8 @@ static void monitor_flush_locked(Monitor *mon) =20 void monitor_flush(Monitor *mon) { - qemu_mutex_lock(&mon->mon_lock); + QEMU_LOCK_GUARD(&mon->mon_lock); monitor_flush_locked(mon); - qemu_mutex_unlock(&mon->mon_lock); } =20 /* flush at every end of line */ --=20 2.40.1 From nobody Sat May 18 10:57:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684405117; cv=none; d=zohomail.com; s=zohoarc; b=kS6EH8u+BofnAWVUj7oW3EnUNPXTOH+GAOzEWrusdynNITMd03wcw2GOysQZ34H+2EHLuixra5cPxBeLHxTWIF8XBrGZzIID+L4hjPX07tGRFDHKOWMrIhQqT+w+0lq63JVNzoTpCKI043xt6bG+reQIPvEz4JnnZKz4qcp1IdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684405117; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YW2RiDVuo8s3fHdACuQ7sebR9x64p06vs4OxuqmRjaY=; b=f2ye8XF2SWLWuEyLN0aXbrYPvSTpnooe175By5HUD5PrQoO6GogayS1JGO91MTQu/7q4VbYZ9dHdXSaPkcz32+smZfR7UR1hquw1ZmSIKxm6GK9qsjIshrDg28kTHOef1i2Xn673dzn9V9FF7jO6UeSczo2biWYz+wjfva6OHJ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684405117702514.082017521617; Thu, 18 May 2023 03:18:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzai8-0007Cf-Js; Thu, 18 May 2023 06:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai6-0007CO-MR for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai5-0004la-A8 for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:14 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-207-NVvBqoMNNLuGFqKZOFSFrQ-1; Thu, 18 May 2023 06:18:11 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-966329c872bso247420966b.1 for ; Thu, 18 May 2023 03:18:11 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id x23-20020a1709060a5700b00966447c76f3sm779511ejf.39.2023.05.18.03.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 03:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684405092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YW2RiDVuo8s3fHdACuQ7sebR9x64p06vs4OxuqmRjaY=; b=f8aJ/s21PiifWRRXMuOxRfsG7fAG6i3wGrUgQRhtMfBZfOu5+H1KE5JHWklPLtn9vrtBnu YdueSauKcmTJt6qB4anuVi0lO3GuFr+Ka7EEZ/tDx5XkvZgF+vVcV0WbYpRRLTVqRvqhwR yzvGNVvHvtMUhqOwY4N0XjV1noS6gRQ= X-MC-Unique: NVvBqoMNNLuGFqKZOFSFrQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684405089; x=1686997089; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YW2RiDVuo8s3fHdACuQ7sebR9x64p06vs4OxuqmRjaY=; b=B5Fz48NSBa2gll4LEYFVNLRUojDNdiJObcqU3hE2QOVnpoj3X01awmPuDSmVJbUBLP qIloMh4LP4yNJyCMUIpJV1ZcN0+9COJJiZ6T6ol6m3oHtO+glZSsIesQrH7V61pSosop zFOzulZ6WQPdOG96jW3+NNEZsyDohQ6k1i9AIOnt6w4YnK8NoyziTztRbh9g2sUvw6Xy scN0CrMzrbugtzCithFjpSwzHMflNUyu+zv8wbUWDutUUk4warrfKsXxKZCTi62uRCSv RVF+e7/Irqfwlbe/pVuAqpT9YfMqlQfX0KMXkU7TTfg6uTGKOJ0ykvFs9WFjMnBreppT xFNA== X-Gm-Message-State: AC+VfDyeCEfaK2rLc4YRo+6bHFutByiThu+dIV0HNpe9Xk8r1ZA2Tmhk kwrkxMBLwwtkbDowGAIYXBvUDzv7GFk6c47xhZSOzW8uCBE/JbK19aZaStIIt6J0JnWvcKySyT/ EQ7QIgmLu0pE+r1Acz+SOItfYMQ/EksC6/U17Vx+vAT1bjS7OreIgAnRqM2QseBTKAnj592vVxD 8= X-Received: by 2002:a17:907:318b:b0:957:17c5:8705 with SMTP id xe11-20020a170907318b00b0095717c58705mr37373711ejb.51.1684405089737; Thu, 18 May 2023 03:18:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ78/r05KgtbdH43ioHuiG/XQmekZjMBr2M9RWnNOXQj7dkYo1MEypzCps0tD+xqrL2iIkRvNA== X-Received: by 2002:a17:907:318b:b0:957:17c5:8705 with SMTP id xe11-20020a170907318b00b0095717c58705mr37373697ejb.51.1684405089337; Thu, 18 May 2023 03:18:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: armbru@redhat.com Subject: [PATCH 2/4] monitor: allow calling monitor_resume under mon_lock Date: Thu, 18 May 2023 12:18:02 +0200 Message-Id: <20230518101804.992085-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518101804.992085-1-pbonzini@redhat.com> References: <20230518101804.992085-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684405118749100001 Content-Type: text/plain; charset="utf-8" Move monitor_resume()'s call to readline_show_prompt() outside the potentially locked section. Reuse the existing monitor_accept_input() bottom half for this purpose. Signed-off-by: Paolo Bonzini --- monitor/monitor.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monitor/monitor.c b/monitor/monitor.c index 4b11bca2a21d..7080d2da8ec6 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -567,6 +567,12 @@ static void monitor_accept_input(void *opaque) { Monitor *mon =3D opaque; =20 + if (!monitor_is_qmp(mon)) { + MonitorHMP *hmp_mon =3D container_of(mon, MonitorHMP, common); + assert(hmp_mon->rs); + readline_show_prompt(hmp_mon->rs); + } + qemu_chr_fe_accept_input(&mon->chr); } =20 @@ -585,12 +591,6 @@ void monitor_resume(Monitor *mon) ctx =3D qemu_get_aio_context(); } =20 - if (!monitor_is_qmp(mon)) { - MonitorHMP *hmp_mon =3D container_of(mon, MonitorHMP, common); - assert(hmp_mon->rs); - readline_show_prompt(hmp_mon->rs); - } - aio_bh_schedule_oneshot(ctx, monitor_accept_input, mon); } =20 --=20 2.40.1 From nobody Sat May 18 10:57:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684405174; cv=none; d=zohomail.com; s=zohoarc; b=jIvwTM2pMD4VmGbfk7cFlxossMNGEFZmTgY3X+sUfxuBR75rNOgGCpN9h88BrLJomYmyQbQyUZ/EJveqDqim9cXJ7WX+NeN5jllpnNmy6p/+Oz3Wm+vejCoX7UQo51/PlGslmzNV6LwEYCVZKmT87n4cf84krWY3IeXzeu4GaiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684405174; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=b8Klag7Ne4wY7gy2Rwf1dxdEH04Qv4qwDtxZI5ZuCHQ=; b=X4/ygxZKZa5ZAK4/wBiGLxHpVEo14q4Y2OnRaFPkaQlAH+S408Z5cseSZVlkr6owoHxJORFk7nshvQqPKG+/kiVCDwHZ3zha/uTeTeK16zkjtz65sXfVik6QO1aTlIIE8DjOzdnWjGQhQevHL2hd1+m9IdM/k8Q9ARMkg7Uxt7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16844051740765.983247926852869; Thu, 18 May 2023 03:19:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzaiA-0007DE-FG; Thu, 18 May 2023 06:18:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai8-0007Ch-KB for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai7-0004lx-3u for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:16 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-321-R_G32j-KNLupTVj7oFh1ng-1; Thu, 18 May 2023 06:18:13 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-506b21104faso371202a12.1 for ; Thu, 18 May 2023 03:18:12 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id b19-20020aa7d493000000b0050dab547fc6sm393771edr.74.2023.05.18.03.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 03:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684405094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b8Klag7Ne4wY7gy2Rwf1dxdEH04Qv4qwDtxZI5ZuCHQ=; b=C45Yaper20G8oDR2gwin6VgMdB7PV6QciMupgNFs2G2wXsO9qKo5yaDoxuanS3JZK1dMdk 92Cd3IWvyf3kFvmL78KPipcgdN9aMGM3FStEjiu7tT54CqBQU71VEOELQ7lOOcq7hWMoFt jek4CaguYg8cPmGkGOdqQ4nhqeymVDs= X-MC-Unique: R_G32j-KNLupTVj7oFh1ng-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684405091; x=1686997091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b8Klag7Ne4wY7gy2Rwf1dxdEH04Qv4qwDtxZI5ZuCHQ=; b=c/1c2ptCDS0odUfmPLKufAL2k4GmQUmarqWad8UzyJMSz9UTPJ9ABJULt9/qtjBKgj 9BP968TtRuIP7PAilVBJKw5lFV8F2lg9kVh4enpiKe/fOp66srQumt75LKomupK9ADfc TbHNUGx3pfgc2tf8v0+sOXfAhMoPGN+JMmzs40TMx3dsnnShnayYuITy8mA0DpSBoc4C zarorzf1urNRSbRKiXK5bDMseRLw5Q32xH7WG/0lhXvUKxBJQEzgkU7SlzV4tUO3fJ/x Vt3TcUlNesyC41cY7tCqRtxqjka73yrEvoR9IpguxH+Sle4PdHT1MBLoarhrrzfcbEIy 1q9A== X-Gm-Message-State: AC+VfDxHsJBvj1ftkJGK5woeRY7oJzmEJCxXTxnEx1Fn/5OEBmYitTXe 1M9ff9cNSG+Oa+VfMeo5ZWRZIkxSu8/hFd1mpWBRTxkqtfAQgDoXVg0ftPzlze1bgo90s70Ruby kJN3zhSF0+9+SO8XOcJ4OtoTuHrh//DbpgpnLXpfybq7Qbnj0IgdSFYqb1nnMnWWGR/m+N2iUvC M= X-Received: by 2002:a05:6402:150e:b0:509:c669:1e93 with SMTP id f14-20020a056402150e00b00509c6691e93mr3983577edw.23.1684405091594; Thu, 18 May 2023 03:18:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kQ8apKngUw4pzN2XQw0sm9SLGuyurtQCXuU7RoWtYasWikK7JQ3PO7rPDEm4wcZ9mO/5SHQ== X-Received: by 2002:a05:6402:150e:b0:509:c669:1e93 with SMTP id f14-20020a056402150e00b00509c6691e93mr3983569edw.23.1684405091164; Thu, 18 May 2023 03:18:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: armbru@redhat.com Subject: [PATCH 3/4] monitor: add more *_locked() functions Date: Thu, 18 May 2023 12:18:03 +0200 Message-Id: <20230518101804.992085-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518101804.992085-1-pbonzini@redhat.com> References: <20230518101804.992085-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684405174981100001 Content-Type: text/plain; charset="utf-8" Allow flushing and printing to the monitor while mon->mon_lock is held. This will help cleaning up the locking of mon->mux_out and mon->suspend_cnt. Signed-off-by: Paolo Bonzini Reviewed-by: Markus Armbruster Reviewed-by: Richard Henderson --- include/monitor/monitor.h | 3 +++ monitor/monitor.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 033390f69917..965f5d545003 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -40,6 +40,9 @@ void monitor_flush(Monitor *mon); int monitor_set_cpu(Monitor *mon, int cpu_index); int monitor_get_cpu_index(Monitor *mon); =20 +int monitor_puts_locked(Monitor *mon, const char *str); +void monitor_flush_locked(Monitor *mon); + void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, uint64_t size, Error **err= p); =20 void monitor_read_command(MonitorHMP *mon, int show_prompt); diff --git a/monitor/monitor.c b/monitor/monitor.c index 7080d2da8ec6..20e33e28d20d 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -154,8 +154,6 @@ static inline bool monitor_is_hmp_non_interactive(const= Monitor *mon) return !monitor_uses_readline(container_of(mon, MonitorHMP, common)); } =20 -static void monitor_flush_locked(Monitor *mon); - static gboolean monitor_unblocked(void *do_not_use, GIOCondition cond, void *opaque) { @@ -168,7 +166,7 @@ static gboolean monitor_unblocked(void *do_not_use, GIO= Condition cond, } =20 /* Caller must hold mon->mon_lock */ -static void monitor_flush_locked(Monitor *mon) +void monitor_flush_locked(Monitor *mon) { int rc; size_t len; @@ -207,12 +205,11 @@ void monitor_flush(Monitor *mon) } =20 /* flush at every end of line */ -int monitor_puts(Monitor *mon, const char *str) +int monitor_puts_locked(Monitor *mon, const char *str) { int i; char c; =20 - qemu_mutex_lock(&mon->mon_lock); for (i =3D 0; str[i]; i++) { c =3D str[i]; if (c =3D=3D '\n') { @@ -223,11 +220,16 @@ int monitor_puts(Monitor *mon, const char *str) monitor_flush_locked(mon); } } - qemu_mutex_unlock(&mon->mon_lock); =20 return i; } =20 +int monitor_puts(Monitor *mon, const char *str) +{ + QEMU_LOCK_GUARD(&mon->mon_lock); + return monitor_puts_locked(mon, str); +} + int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) { char *buf; --=20 2.40.1 From nobody Sat May 18 10:57:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684405114; cv=none; d=zohomail.com; s=zohoarc; b=bPogt88+IAyitnkwY1jiZ+obpLwP871Bin8nov41eDU2RPT0Lp4bViVNTmEN94kvhXdx1NXueYfVtsz58BOzH2MlpMGlpQvAUeXHKkm/HzU+Bq9uDjNGn3JlC229MVDbBYjHtttveUHw/mLI6adouoXcMOZu8ncNJqjgIkkpckc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684405114; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9ARNzquw7mUdiiwCSV/Vc8bgofSPwWjN2mPfJ/KxMvE=; b=EJeFEdtK03RmD3Z/X9ksXGV/z++ACLF8sYXCIsfURrGTnmUBYV/LSc2Seey3tTnPnZPKtlehoOWtfgUAsswcIOlnLxRKtdn6cNnRnsBtuXsLaZTaKNQT+dG+TiHBXoA0y9SrAf5nCcSRTOOqSCGfr2dKSQSHjnVGO5jtLDfOlhM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684405114019634.6020054864782; Thu, 18 May 2023 03:18:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzaiC-0007Fs-1f; Thu, 18 May 2023 06:18:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzaiA-0007DO-OX for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzai8-0004m5-NW for qemu-devel@nongnu.org; Thu, 18 May 2023 06:18:18 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-fff-AMxPPl-5pUQNrvOwUA-1; Thu, 18 May 2023 06:18:14 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-510d8e4416cso1830538a12.3 for ; Thu, 18 May 2023 03:18:14 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id s9-20020a1709066c8900b0094f124a37c4sm795012ejr.18.2023.05.18.03.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 03:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684405096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9ARNzquw7mUdiiwCSV/Vc8bgofSPwWjN2mPfJ/KxMvE=; b=KflDG3mtb/QmAblYrb2ylUfQsl/YqpAoQaD+j5lzhtggbRS02gGkma0W+Q5s2wTPOeGpR4 Sq7E/XNkwUdfltJExReE1tra8k8bTs7+yJd3260qvHc7iU47zSF7RO3nSgIXRS5uGEGbvo 7G8ikYZ9X7sHKKZDiFBX9AtbETOZqPk= X-MC-Unique: fff-AMxPPl-5pUQNrvOwUA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684405093; x=1686997093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ARNzquw7mUdiiwCSV/Vc8bgofSPwWjN2mPfJ/KxMvE=; b=jYHWo887xyFcdBo5NOe8XVCcAcQlSY+++6qzci1ckcJUeRWzTBAdZqmwRjqxnvmud9 3pUAkn7y2cCNHN5UMMkaGersGykXVLY4ZOjwy8ppQjTdXSdE7t69M6BVHE1leS2QgVZi ALIV0Ra9WZ03alsiDiEPUy3dSpO6Q4Q576yTb6US6Jkv+QAdCxArtYJNW4bmnpXvpW/2 K9flp4t55b6VvPV/SLn3x1bM80Zj5v/SUvV1XpRfoXSd4AATb4VcF++D8qnP5A0P3fZT Yxu/e/8YdXp5jqCjf0jH3+muy5avUFt6t/Si7gBj6+YT4mwk9RAKbPWIn2Gb9QwiZ1Zz m3gA== X-Gm-Message-State: AC+VfDx0UqXatEYzV6sSqS6NSSHd6bLTUq+CF+R/o+0Jq+Gfy4btHRL4 UJeamY7z39OlZ4wkhjseT4i0BXm0eaJHRVqiqO5Thqq4cR2puqEIomsbx5HAzlSAymCh3CcksYg QFa8s7cGjTZr7H/itLtg9XuD5n4egBqO6fOo8zVtXDDZI5HWA8ZPgT7VA/Tka56un5l5zYb1pj6 U= X-Received: by 2002:a17:907:9304:b0:94a:7716:e649 with SMTP id bu4-20020a170907930400b0094a7716e649mr39365623ejc.13.1684405093270; Thu, 18 May 2023 03:18:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vhXlB6N3MACe83P0I6AEIrkQQlB9B4wSIw20/2OHXcG/TaaC78ygeIVQWNq0mOxGrFy047w== X-Received: by 2002:a17:907:9304:b0:94a:7716:e649 with SMTP id bu4-20020a170907930400b0094a7716e649mr39365596ejc.13.1684405092795; Thu, 18 May 2023 03:18:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: armbru@redhat.com Subject: [PATCH 4/4] monitor: do not use mb_read/mb_set for suspend_cnt Date: Thu, 18 May 2023 12:18:04 +0200 Message-Id: <20230518101804.992085-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518101804.992085-1-pbonzini@redhat.com> References: <20230518101804.992085-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684405116148100001 Content-Type: text/plain; charset="utf-8" Clean up monitor_event to just use monitor_suspend/monitor_resume, using mon->mux_out to protect against incorrect nesting (especially on startup). The only remaining case of reading suspend_cnt is in the can_read callback, which is just advisory and can use qatomic_read. As an extra benefit, mux_out is now simply protected by mon_lock. Also, moving the prompt to after the event loop has started removes it from the output in some error cases, where QEMU does not actually start successfully. It is not a full fix and it would be nice to also remove the monitor heading, but this is already a small (though unintentional) improvement. Signed-off-by: Paolo Bonzini --- monitor/hmp.c | 41 ++++++++++++++++------------------- monitor/monitor-internal.h | 3 +-- monitor/monitor.c | 9 ++++++-- tests/qemu-iotests/051.out | 4 ++-- tests/qemu-iotests/051.pc.out | 20 ++++++++--------- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/monitor/hmp.c b/monitor/hmp.c index 5cab56d355c8..69c1b7e98abb 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1401,45 +1401,42 @@ static void monitor_read(void *opaque, const uint8_= t *buf, int size) static void monitor_event(void *opaque, QEMUChrEvent event) { Monitor *mon =3D opaque; - MonitorHMP *hmp_mon =3D container_of(mon, MonitorHMP, common); =20 switch (event) { case CHR_EVENT_MUX_IN: qemu_mutex_lock(&mon->mon_lock); - mon->mux_out =3D 0; - qemu_mutex_unlock(&mon->mon_lock); - if (mon->reset_seen) { - readline_restart(hmp_mon->rs); + if (mon->mux_out) { + mon->mux_out =3D 0; monitor_resume(mon); - monitor_flush(mon); - } else { - qatomic_mb_set(&mon->suspend_cnt, 0); } + qemu_mutex_unlock(&mon->mon_lock); break; =20 case CHR_EVENT_MUX_OUT: - if (mon->reset_seen) { - if (qatomic_mb_read(&mon->suspend_cnt) =3D=3D 0) { - monitor_printf(mon, "\n"); - } - monitor_flush(mon); - monitor_suspend(mon); - } else { - qatomic_inc(&mon->suspend_cnt); - } qemu_mutex_lock(&mon->mon_lock); - mon->mux_out =3D 1; + if (!mon->mux_out) { + if (mon->reset_seen && !mon->suspend_cnt) { + monitor_puts_locked(mon, "\n"); + } else { + monitor_flush_locked(mon); + } + monitor_suspend(mon); + mon->mux_out =3D 1; + } qemu_mutex_unlock(&mon->mon_lock); break; =20 case CHR_EVENT_OPENED: monitor_printf(mon, "QEMU %s monitor - type 'help' for more " "information\n", QEMU_VERSION); - if (!mon->mux_out) { - readline_restart(hmp_mon->rs); - readline_show_prompt(hmp_mon->rs); - } + qemu_mutex_lock(&mon->mon_lock); mon->reset_seen =3D 1; + if (!mon->mux_out) { + /* Suspend-resume forces the prompt to be printed. */ + monitor_suspend(mon); + monitor_resume(mon); + } + qemu_mutex_unlock(&mon->mon_lock); mon_refcount++; break; =20 diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 53e3808054c7..61c9b6916db3 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -94,7 +94,6 @@ typedef struct HMPCommand { =20 struct Monitor { CharBackend chr; - int reset_seen; int suspend_cnt; /* Needs to be accessed atomically */ bool is_qmp; bool skip_flush; @@ -115,8 +114,8 @@ struct Monitor { QLIST_HEAD(, mon_fd_t) fds; GString *outbuf; guint out_watch; - /* Read under either BQL or mon_lock, written with BQL+mon_lock. */ int mux_out; + int reset_seen; }; =20 struct MonitorHMP { diff --git a/monitor/monitor.c b/monitor/monitor.c index 20e33e28d20d..15f97538ef2b 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -569,10 +569,15 @@ static void monitor_accept_input(void *opaque) { Monitor *mon =3D opaque; =20 - if (!monitor_is_qmp(mon)) { + qemu_mutex_lock(&mon->mon_lock); + if (!monitor_is_qmp(mon) && mon->reset_seen) { MonitorHMP *hmp_mon =3D container_of(mon, MonitorHMP, common); assert(hmp_mon->rs); + readline_restart(hmp_mon->rs); + qemu_mutex_unlock(&mon->mon_lock); readline_show_prompt(hmp_mon->rs); + } else { + qemu_mutex_unlock(&mon->mon_lock); } =20 qemu_chr_fe_accept_input(&mon->chr); @@ -603,7 +608,7 @@ int monitor_can_read(void *opaque) { Monitor *mon =3D opaque; =20 - return !qatomic_mb_read(&mon->suspend_cnt); + return !qatomic_read(&mon->suspend_cnt); } =20 void monitor_list_append(Monitor *mon) diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out index e5ddb03bda1d..d46215640506 100644 --- a/tests/qemu-iotests/051.out +++ b/tests/qemu-iotests/051.out @@ -74,7 +74,7 @@ QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo= #12: Invalid node-name: 'fo =20 Testing: -device virtio-scsi -device scsi-hd QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device scsi-hd: drive property not set +QEMU_PROG: -device scsi-hd: drive property not set =20 =20 =3D=3D=3D Overriding backing file =3D=3D=3D @@ -134,7 +134,7 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive if=3Dvirtio QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dvirtio: Device needs media, but drive is emp= ty +QEMU_PROG: -drive if=3Dvirtio: Device needs media, but drive is empty =20 =20 =3D=3D=3D Attach to node in non-default iothread =3D=3D=3D diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index bade1ff3b929..4d4af5a486df 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -74,7 +74,7 @@ QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo= #12: Invalid node-name: 'fo =20 Testing: -device virtio-scsi -device scsi-hd QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device scsi-hd: drive property not set +QEMU_PROG: -device scsi-hd: drive property not set =20 =20 =3D=3D=3D Overriding backing file =3D=3D=3D @@ -142,11 +142,11 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive if=3Dide QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Device needs media, but drive is empty +QEMU_PROG: Device needs media, but drive is empty =20 Testing: -drive if=3Dvirtio QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dvirtio: Device needs media, but drive is emp= ty +QEMU_PROG: -drive if=3Dvirtio: Device needs media, but drive is empty =20 Testing: -drive if=3Dnone,id=3Ddisk -device ide-cd,drive=3Ddisk QEMU X.Y.Z monitor - type 'help' for more information @@ -158,22 +158,22 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive if=3Dnone,id=3Ddisk -device ide-hd,drive=3Ddisk QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device ide-hd,drive=3Ddisk: Device needs media, but dri= ve is empty +QEMU_PROG: -device ide-hd,drive=3Ddisk: Device needs media, but drive is e= mpty =20 Testing: -drive if=3Dnone,id=3Ddisk -device lsi53c895a -device scsi-hd,dri= ve=3Ddisk QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device scsi-hd,drive=3Ddisk: Device needs media, but dr= ive is empty +QEMU_PROG: -device scsi-hd,drive=3Ddisk: Device needs media, but drive is = empty =20 =20 =3D=3D=3D Attach to node in non-default iothread =3D=3D=3D =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e ide-hd,drive=3Ddisk,share-rw=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device ide-hd,drive=3Ddisk,share-rw=3Don: Cannot change= iothread of active block backend +QEMU_PROG: -device ide-hd,drive=3Ddisk,share-rw=3Don: Cannot change iothre= ad of active block backend =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e virtio-blk-pci,drive=3Ddisk,share-rw=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device virtio-blk-pci,drive=3Ddisk,share-rw=3Don: Canno= t change iothread of active block backend +QEMU_PROG: -device virtio-blk-pci,drive=3Ddisk,share-rw=3Don: Cannot chang= e iothread of active block backend =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e lsi53c895a,id=3Dlsi0 -device scsi-hd,bus=3Dlsi0.0,drive=3Ddisk,share-rw= =3Don QEMU X.Y.Z monitor - type 'help' for more information @@ -185,7 +185,7 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e virtio-blk-pci,drive=3Ddisk,iothread=3Dthread0,share-rw=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device virtio-blk-pci,drive=3Ddisk,iothread=3Dthread0,s= hare-rw=3Don: Cannot change iothread of active block backend +QEMU_PROG: -device virtio-blk-pci,drive=3Ddisk,iothread=3Dthread0,share-rw= =3Don: Cannot change iothread of active block backend =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e virtio-scsi,id=3Dvirtio-scsi1,iothread=3Dthread0 -device scsi-hd,bus=3Dvi= rtio-scsi1.0,drive=3Ddisk,share-rw=3Don QEMU X.Y.Z monitor - type 'help' for more information @@ -204,7 +204,7 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dide,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Block node is read-only +QEMU_PROG: Block node is read-only =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dvirtio,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information @@ -220,7 +220,7 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,id=3Ddisk,readonly=3Don = -device ide-hd,drive=3Ddisk QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device ide-hd,drive=3Ddisk: Block node is read-only +QEMU_PROG: -device ide-hd,drive=3Ddisk: Block node is read-only =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,id=3Ddisk,readonly=3Don = -device lsi53c895a -device scsi-hd,drive=3Ddisk QEMU X.Y.Z monitor - type 'help' for more information --=20 2.40.1