From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495543124414477.6046848658382; Tue, 23 May 2017 05:38:44 -0700 (PDT) Received: from localhost ([::1]:48790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD95H-00039y-03 for importer@patchew.org; Tue, 23 May 2017 08:38:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xZ-0005kt-53 for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xV-00012v-Rb for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xV-00012D-Kq for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D3AA81243; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 671677842B; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D30F6113864A; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9D3AA81243 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9D3AA81243 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:30 +0200 Message-Id: <1495542638-12335-2-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 23 May 2017 12:30:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] scripts/qmp/qom-set: fix the value argument passed to srv.command() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz When invoking the script with -s, we end up passing a bogus value to QEMU: $ ./scripts/qmp/qom-set -s /var/tmp/qmp-sock-exp /machine.accel kvm {} $ ./scripts/qmp/qom-get -s /var/tmp/qmp-sock-exp /machine.accel /var/tmp/qmp-sock-exp This happens because sys.argv[2] isn't necessarily the command line argument that holds the value. It is sys.argv[4] when -s was also passed. Actually, the code already has a variable to handle that. This patch simply uses it. Signed-off-by: Greg Kurz Message-Id: <149373610338.5144.9635049015143453288.stgit@bahia.lan> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qmp/qom-set | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qmp/qom-set b/scripts/qmp/qom-set index 54ecfec..94e2778 100755 --- a/scripts/qmp/qom-set +++ b/scripts/qmp/qom-set @@ -61,4 +61,4 @@ else: srv =3D QEMUMonitorProtocol(socket_path) srv.connect() =20 -print srv.command('qom-set', path=3Dpath, property=3Dprop, value=3Dsys.arg= v[2]) +print srv.command('qom-set', path=3Dpath, property=3Dprop, value=3Dvalue) --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495542981886261.7066369817776; Tue, 23 May 2017 05:36:21 -0700 (PDT) Received: from localhost ([::1]:48782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD92y-0001VP-Ke for importer@patchew.org; Tue, 23 May 2017 08:36:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xb-0005lm-Iz for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xV-000135-TL for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xV-00012F-MU for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A381EC057EC9 for ; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68C277A4CD for ; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D5940113864C; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A381EC057EC9 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A381EC057EC9 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:31 +0200 Message-Id: <1495542638-12335-3-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 23 May 2017 12:30:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] sockets: Plug memory leak in socket_address_flatten() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" socket_address_flatten() leaks a SocketAddress when its argument is null. Happens when opening a ChardevBackend of type 'udp' that is configured without a local address. Screwed up in commit bd269ebc due to last minute semantic conflict resolution. Spotted by Coverity. Signed-off-by: Markus Armbruster Message-Id: <1494866344-11013-1-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake --- util/qemu-sockets.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index d8183f7..b39ae74 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -1338,12 +1338,14 @@ char *socket_address_to_string(struct SocketAddress= *addr, Error **errp) =20 SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy) { - SocketAddress *addr =3D g_new(SocketAddress, 1); + SocketAddress *addr; =20 if (!addr_legacy) { return NULL; } =20 + addr =3D g_new(SocketAddress, 1); + switch (addr_legacy->type) { case SOCKET_ADDRESS_LEGACY_KIND_INET: addr->type =3D SOCKET_ADDRESS_TYPE_INET; --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495542866399853.694458664964; Tue, 23 May 2017 05:34:26 -0700 (PDT) Received: from localhost ([::1]:48767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD917-0008Ua-1u for importer@patchew.org; Tue, 23 May 2017 08:34:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xZ-0005kv-5L for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xW-00013y-Oi for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xW-00013A-JD for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1FFC61980 for ; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B7407FCEB; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D8942113864D; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A1FFC61980 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A1FFC61980 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:32 +0200 Message-Id: <1495542638-12335-4-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 23 May 2017 12:30:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] shutdown: Simplify shutdown_signal X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake There is no signal 0 (kill(pid, 0) has special semantics to probe whether a process is alive), rather than actually sending a signal 0). So we can use the simpler 0, instead of -1, for our sentinel of whether a shutdown request due to a signal has happened. Suggested-by: Markus Armbruster Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster Reviewed-by: Alistair Francis Message-Id: <20170515214114.15442-2-eblake@redhat.com> Signed-off-by: Markus Armbruster --- vl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index 1512df6..b42b0b3 100644 --- a/vl.c +++ b/vl.c @@ -1598,7 +1598,7 @@ void vm_state_notify(int running, RunState state) } =20 static int reset_requested; -static int shutdown_requested, shutdown_signal =3D -1; +static int shutdown_requested, shutdown_signal; static pid_t shutdown_pid; static int powerdown_requested; static int debug_requested; @@ -1629,7 +1629,7 @@ static int qemu_shutdown_requested(void) =20 static void qemu_kill_report(void) { - if (!qtest_driver() && shutdown_signal !=3D -1) { + if (!qtest_driver() && shutdown_signal) { if (shutdown_pid =3D=3D 0) { /* This happens for eg ^C at the terminal, so it's worth * avoiding printing an odd message in that case. @@ -1643,7 +1643,7 @@ static void qemu_kill_report(void) shutdown_cmd ? shutdown_cmd : ""= ); g_free(shutdown_cmd); } - shutdown_signal =3D -1; + shutdown_signal =3D 0; } } =20 --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495542870939527.1387152131088; Tue, 23 May 2017 05:34:30 -0700 (PDT) Received: from localhost ([::1]:48768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD919-0008WC-Nw for importer@patchew.org; Tue, 23 May 2017 08:34:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xZ-0005kx-5R for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xW-00013Q-4m for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60384) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xV-00012P-RL for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D24AF7249C for ; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 703747842F; Tue, 23 May 2017 12:30:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DBD271138650; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D24AF7249C Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D24AF7249C From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:33 +0200 Message-Id: <1495542638-12335-5-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 23 May 2017 12:30:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] shutdown: Prepare for use of an enum in reset/shutdown_request X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake We want to track why a guest was shutdown; in particular, being able to tell the difference between a guest request (such as ACPI request) and host request (such as SIGINT) will prove useful to libvirt. Since all requests eventually end up changing shutdown_requested in vl.c, the logical change is to make that value track the reason, rather than its current 0/1 contents. Since command-line options control whether a reset request is turned into a shutdown request instead, the same treatment is given to reset_requested. This patch adds an internal enum ShutdownCause that describes reasons that a shutdown can be requested, and changes qemu_system_reset() to pass the reason through, although for now nothing is actually changed with regards to what gets reported. The enum could be exported via QAPI at a later date, if deemed necessary, but for now, there has not been a request to expose that much detail to end clients. For the most part, we turn 0 into SHUTDOWN_CAUSE_NONE, and 1 into SHUTDOWN_CAUSE_HOST_ERROR; the only specific case where we have enough information right now to use a different value is when we are reacting to a host signal. It will take a further patch to edit all call-sites that can trigger a reset or shutdown request to properly pass in any other reasons; this patch includes TODOs to point such places out. qemu_system_reset() trades its 'bool report' parameter for a 'ShutdownCause reason', with all non-zero values having the same effect; this lets us get rid of the weird #defines for VMRESET_* as synonyms for bools. Signed-off-by: Eric Blake Message-Id: <20170515214114.15442-3-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- hw/i386/xen/xen-hvm.c | 7 +++++-- include/sysemu/sysemu.h | 23 ++++++++++++++++----- migration/colo.c | 2 +- migration/savevm.c | 2 +- vl.c | 53 ++++++++++++++++++++++++++++++---------------= ---- 5 files changed, 58 insertions(+), 29 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index b1c05ff..222d89a 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1089,11 +1089,14 @@ static void cpu_handle_ioreq(void *opaque) * causes Xen to powerdown the domain. */ if (runstate_is_running()) { + ShutdownCause request; + if (qemu_shutdown_requested_get()) { destroy_hvm_domain(false); } - if (qemu_reset_requested_get()) { - qemu_system_reset(VMRESET_REPORT); + request =3D qemu_reset_requested_get(); + if (request) { + qemu_system_reset(request); destroy_hvm_domain(true); } } diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 83c1ceb..ba633d7 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -33,8 +33,21 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMC= hangeStateHandler *cb, void qemu_del_vm_change_state_handler(VMChangeStateEntry *e); void vm_state_notify(int running, RunState state); =20 -#define VMRESET_SILENT false -#define VMRESET_REPORT true +/* Enumeration of various causes for shutdown. */ +typedef enum ShutdownCause { + SHUTDOWN_CAUSE_NONE, /* No shutdown request pending */ + SHUTDOWN_CAUSE_HOST_ERROR, /* An error prevents further use of gues= t */ + SHUTDOWN_CAUSE_HOST_QMP, /* Reaction to a QMP command, like 'quit= ' */ + SHUTDOWN_CAUSE_HOST_SIGNAL, /* Reaction to a signal, such as SIGINT = */ + SHUTDOWN_CAUSE_HOST_UI, /* Reaction to UI event, like window clo= se */ + SHUTDOWN_CAUSE_GUEST_SHUTDOWN,/* Guest shutdown/suspend request, via + ACPI or other hardware-specific means= */ + SHUTDOWN_CAUSE_GUEST_RESET, /* Guest reset request, and command line + turns that into a shutdown */ + SHUTDOWN_CAUSE_GUEST_PANIC, /* Guest panicked, and command line turns + that into a shutdown */ + SHUTDOWN_CAUSE__MAX, +} ShutdownCause; =20 void vm_start(void); int vm_prepare_start(void); @@ -62,10 +75,10 @@ void qemu_system_debug_request(void); void qemu_system_vmstop_request(RunState reason); void qemu_system_vmstop_request_prepare(void); bool qemu_vmstop_requested(RunState *r); -int qemu_shutdown_requested_get(void); -int qemu_reset_requested_get(void); +ShutdownCause qemu_shutdown_requested_get(void); +ShutdownCause qemu_reset_requested_get(void); void qemu_system_killed(int signal, pid_t pid); -void qemu_system_reset(bool report); +void qemu_system_reset(ShutdownCause reason); void qemu_system_guest_panicked(GuestPanicInformation *info); size_t qemu_target_page_size(void); =20 diff --git a/migration/colo.c b/migration/colo.c index 963c802..12d355a 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -623,7 +623,7 @@ void *colo_process_incoming_thread(void *opaque) } =20 qemu_mutex_lock_iothread(); - qemu_system_reset(VMRESET_SILENT); + qemu_system_reset(SHUTDOWN_CAUSE_NONE); vmstate_loading =3D true; if (qemu_loadvm_state(fb) < 0) { error_report("COLO: loadvm failed"); diff --git a/migration/savevm.c b/migration/savevm.c index f5e8194..752bf64 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2285,7 +2285,7 @@ int load_vmstate(const char *name, Error **errp) return -EINVAL; } =20 - qemu_system_reset(VMRESET_SILENT); + qemu_system_reset(SHUTDOWN_CAUSE_NONE); mis->from_src_file =3D f; =20 aio_context_acquire(aio_context); diff --git a/vl.c b/vl.c index b42b0b3..d90ae3f 100644 --- a/vl.c +++ b/vl.c @@ -1597,8 +1597,9 @@ void vm_state_notify(int running, RunState state) } } =20 -static int reset_requested; -static int shutdown_requested, shutdown_signal; +static ShutdownCause reset_requested; +static ShutdownCause shutdown_requested; +static int shutdown_signal; static pid_t shutdown_pid; static int powerdown_requested; static int debug_requested; @@ -1612,19 +1613,19 @@ static NotifierList wakeup_notifiers =3D NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); static uint32_t wakeup_reason_mask =3D ~(1 << QEMU_WAKEUP_REASON_NONE); =20 -int qemu_shutdown_requested_get(void) +ShutdownCause qemu_shutdown_requested_get(void) { return shutdown_requested; } =20 -int qemu_reset_requested_get(void) +ShutdownCause qemu_reset_requested_get(void) { return reset_requested; } =20 static int qemu_shutdown_requested(void) { - return atomic_xchg(&shutdown_requested, 0); + return atomic_xchg(&shutdown_requested, SHUTDOWN_CAUSE_NONE); } =20 static void qemu_kill_report(void) @@ -1647,14 +1648,15 @@ static void qemu_kill_report(void) } } =20 -static int qemu_reset_requested(void) +static ShutdownCause qemu_reset_requested(void) { - int r =3D reset_requested; + ShutdownCause r =3D reset_requested; + if (r && replay_checkpoint(CHECKPOINT_RESET_REQUESTED)) { - reset_requested =3D 0; + reset_requested =3D SHUTDOWN_CAUSE_NONE; return r; } - return false; + return SHUTDOWN_CAUSE_NONE; } =20 static int qemu_suspend_requested(void) @@ -1686,7 +1688,10 @@ static int qemu_debug_requested(void) return r; } =20 -void qemu_system_reset(bool report) +/* + * Reset the VM. Issue an event unless @reason is SHUTDOWN_CAUSE_NONE. + */ +void qemu_system_reset(ShutdownCause reason) { MachineClass *mc; =20 @@ -1699,7 +1704,8 @@ void qemu_system_reset(bool report) } else { qemu_devices_reset(); } - if (report) { + if (reason) { + /* TODO update event based on reason */ qapi_event_send_reset(&error_abort); } cpu_synchronize_all_post_reset(); @@ -1738,9 +1744,10 @@ void qemu_system_guest_panicked(GuestPanicInformatio= n *info) void qemu_system_reset_request(void) { if (no_reboot) { - shutdown_requested =3D 1; + /* TODO - add a parameter to allow callers to specify reason */ + shutdown_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; } else { - reset_requested =3D 1; + reset_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; } cpu_stop_current(); qemu_notify_event(); @@ -1807,7 +1814,7 @@ void qemu_system_killed(int signal, pid_t pid) /* Cannot call qemu_system_shutdown_request directly because * we are in a signal handler. */ - shutdown_requested =3D 1; + shutdown_requested =3D SHUTDOWN_CAUSE_HOST_SIGNAL; qemu_notify_event(); } =20 @@ -1815,7 +1822,8 @@ void qemu_system_shutdown_request(void) { trace_qemu_system_shutdown_request(); replay_shutdown_request(); - shutdown_requested =3D 1; + /* TODO - add a parameter to allow callers to specify reason */ + shutdown_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; qemu_notify_event(); } =20 @@ -1846,14 +1854,18 @@ void qemu_system_debug_request(void) static bool main_loop_should_exit(void) { RunState r; + ShutdownCause request; + if (qemu_debug_requested()) { vm_stop(RUN_STATE_DEBUG); } if (qemu_suspend_requested()) { qemu_system_suspend(); } - if (qemu_shutdown_requested()) { + request =3D qemu_shutdown_requested(); + if (request) { qemu_kill_report(); + /* TODO update event based on request */ qapi_event_send_shutdown(&error_abort); if (no_shutdown) { vm_stop(RUN_STATE_SHUTDOWN); @@ -1861,9 +1873,10 @@ static bool main_loop_should_exit(void) return true; } } - if (qemu_reset_requested()) { + request =3D qemu_reset_requested(); + if (request) { pause_all_vcpus(); - qemu_system_reset(VMRESET_REPORT); + qemu_system_reset(request); resume_all_vcpus(); if (!runstate_check(RUN_STATE_RUNNING) && !runstate_check(RUN_STATE_INMIGRATE)) { @@ -1872,7 +1885,7 @@ static bool main_loop_should_exit(void) } if (qemu_wakeup_requested()) { pause_all_vcpus(); - qemu_system_reset(VMRESET_SILENT); + qemu_system_reset(SHUTDOWN_CAUSE_NONE); notifier_list_notify(&wakeup_notifiers, &wakeup_reason); wakeup_reason =3D QEMU_WAKEUP_REASON_NONE; resume_all_vcpus(); @@ -4696,7 +4709,7 @@ int main(int argc, char **argv, char **envp) reading from the other reads, because timer polling functions query clock values from the log. */ replay_checkpoint(CHECKPOINT_RESET); - qemu_system_reset(VMRESET_SILENT); + qemu_system_reset(SHUTDOWN_CAUSE_NONE); register_global_state(); if (replay_mode !=3D REPLAY_MODE_NONE) { replay_vmstate_init(); --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495542871675852.137642931817; Tue, 23 May 2017 05:34:31 -0700 (PDT) Received: from localhost ([::1]:48769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD91B-00005f-8O for importer@patchew.org; Tue, 23 May 2017 08:34:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xd-0005oD-Gh for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xX-00014q-Kn for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60478) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xX-00013v-CU for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61F2E7249C for ; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0167678213; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DEC251138657; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 61F2E7249C Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 61F2E7249C From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:34 +0200 Message-Id: <1495542638-12335-6-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 23 May 2017 12:30:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] shutdown: Preserve shutdown cause through replay X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake With the recent addition of ShutdownCause, we want to be able to pass a cause through any shutdown request, and then faithfully replay that cause when later replaying the same sequence. The easiest way is to expand the reply event mechanism to track a series of values for EVENT_SHUTDOWN, one corresponding to each value of ShutdownCause. We are free to change the replay stream as needed, since there are already no guarantees about being able to use a replay stream by any other version of qemu than the one that generated it. The cause is not actually fed back until the next patch changes the signature for requesting a shutdown; a TODO marks that upcoming change. Yes, this uses the gcc/clang extension of a ranged case label, but this is not the first time we've used non-C99 constructs. Signed-off-by: Eric Blake Reviewed-by: Pavel Dovgalyuk Message-Id: <20170515214114.15442-4-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/sysemu/replay.h | 3 ++- replay/replay-internal.h | 3 ++- replay/replay.c | 7 ++++--- vl.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index f1c0712..fa14d0e 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -13,6 +13,7 @@ */ =20 #include "qapi-types.h" +#include "sysemu.h" =20 /* replay clock kinds */ enum ReplayClockKind { @@ -98,7 +99,7 @@ int64_t replay_read_clock(ReplayClockKind kind); /* Events */ =20 /*! Called when qemu shutdown is requested. */ -void replay_shutdown_request(void); +void replay_shutdown_request(ShutdownCause cause); /*! Should be called at check points in the execution. These check points are skipped, if they were not met. Saves checkpoint in the SAVE mode and validates in the PLAY mode. diff --git a/replay/replay-internal.h b/replay/replay-internal.h index ed66ed8..3ebb199 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -22,8 +22,9 @@ enum ReplayEvents { EVENT_EXCEPTION, /* for async events */ EVENT_ASYNC, - /* for shutdown request */ + /* for shutdown requests, range allows recovery of ShutdownCause */ EVENT_SHUTDOWN, + EVENT_SHUTDOWN_LAST =3D EVENT_SHUTDOWN + SHUTDOWN_CAUSE__MAX, /* for character device write event */ EVENT_CHAR_WRITE, /* for character device read all event */ diff --git a/replay/replay.c b/replay/replay.c index f810628..bf94e81 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -49,8 +49,9 @@ bool replay_next_event_is(int event) res =3D true; } switch (replay_state.data_kind) { - case EVENT_SHUTDOWN: + case EVENT_SHUTDOWN ... EVENT_SHUTDOWN_LAST: replay_finish_event(); + /* TODO - pass replay_state.data_kind - EVENT_SHUTDOWN as caus= e */ qemu_system_shutdown_request(); break; default: @@ -170,11 +171,11 @@ bool replay_has_interrupt(void) return res; } =20 -void replay_shutdown_request(void) +void replay_shutdown_request(ShutdownCause cause) { if (replay_mode =3D=3D REPLAY_MODE_RECORD) { replay_mutex_lock(); - replay_put_event(EVENT_SHUTDOWN); + replay_put_event(EVENT_SHUTDOWN + cause); replay_mutex_unlock(); } } diff --git a/vl.c b/vl.c index d90ae3f..909519f 100644 --- a/vl.c +++ b/vl.c @@ -1821,8 +1821,8 @@ void qemu_system_killed(int signal, pid_t pid) void qemu_system_shutdown_request(void) { trace_qemu_system_shutdown_request(); - replay_shutdown_request(); /* TODO - add a parameter to allow callers to specify reason */ + replay_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); shutdown_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; qemu_notify_event(); } --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495542986482738.2743892999657; Tue, 23 May 2017 05:36:26 -0700 (PDT) Received: from localhost ([::1]:48783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD933-0001YC-1z for importer@patchew.org; Tue, 23 May 2017 08:36:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xd-0005o1-8z for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xY-00015N-6s for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39640) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xX-00014N-R7 for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:44 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD2988047D for ; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3BE27EA58; Tue, 23 May 2017 12:30:41 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E1E6511386CB; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DD2988047D Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DD2988047D From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:35 +0200 Message-Id: <1495542638-12335-7-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 23 May 2017 12:30:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] shutdown: Add source information to SHUTDOWN and RESET X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Time to wire up all the call sites that request a shutdown or reset to use the enum added in the previous patch. It would have been less churn to keep the common case with no arguments as meaning guest-triggered, and only modified the host-triggered code paths, via a wrapper function, but then we'd still have to audit that I didn't miss any host-triggered spots; changing the signature forces us to double-check that I correctly categorized all callers. Since command line options can change whether a guest reset request causes an actual reset vs. a shutdown, it's easy to also add the information to reset requests. Signed-off-by: Eric Blake Acked-by: David Gibson [ppc parts] Reviewed-by: Mark Cave-Ayland [SPARC part] Reviewed-by: Cornelia Huck [s390x parts] Message-Id: <20170515214114.15442-5-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- hw/acpi/core.c | 4 ++-- hw/arm/highbank.c | 4 ++-- hw/arm/integratorcp.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/omap1.c | 10 ++++++---- hw/arm/omap2.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stellaris.c | 2 +- hw/arm/tosa.c | 2 +- hw/i386/pc.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/input/pckbd.c | 4 ++-- hw/ipmi/ipmi.c | 4 ++-- hw/isa/lpc_ich9.c | 2 +- hw/mips/boston.c | 2 +- hw/mips/mips_malta.c | 2 +- hw/mips/mips_r4k.c | 4 ++-- hw/misc/arm_sysctl.c | 8 ++++---- hw/misc/cbus.c | 2 +- hw/misc/macio/cuda.c | 4 ++-- hw/misc/slavio_misc.c | 4 ++-- hw/misc/zynq_slcr.c | 2 +- hw/pci-host/apb.c | 4 ++-- hw/pci-host/bonito.c | 2 +- hw/pci-host/piix.c | 2 +- hw/ppc/e500.c | 2 +- hw/ppc/mpc8544_guts.c | 2 +- hw/ppc/ppc.c | 2 +- hw/ppc/ppc405_uc.c | 2 +- hw/ppc/spapr_hcall.c | 2 +- hw/ppc/spapr_rtas.c | 4 ++-- hw/s390x/ipl.c | 2 +- hw/sh4/r2d.c | 2 +- hw/timer/etraxfs_timer.c | 2 +- hw/timer/m48t59.c | 4 ++-- hw/timer/milkymist-sysctl.c | 4 ++-- hw/timer/pxa2xx_timer.c | 2 +- hw/watchdog/watchdog.c | 2 +- hw/xenpv/xen_domainbuild.c | 2 +- hw/xtensa/xtfpga.c | 2 +- include/sysemu/sysemu.h | 4 ++-- kvm-all.c | 6 +++--- os-win32.c | 2 +- qmp.c | 4 ++-- replay/replay.c | 4 ++-- target/alpha/sys_helper.c | 4 ++-- target/arm/psci.c | 4 ++-- target/i386/excp_helper.c | 2 +- target/i386/hax-all.c | 6 +++--- target/i386/helper.c | 2 +- target/i386/kvm.c | 2 +- target/s390x/helper.c | 2 +- target/s390x/kvm.c | 4 ++-- target/s390x/misc_helper.c | 4 ++-- target/sparc/int32_helper.c | 2 +- trace-events | 2 +- ui/cocoa.m | 2 +- ui/sdl.c | 2 +- ui/sdl2.c | 4 ++-- vl.c | 18 ++++++++---------- 60 files changed, 98 insertions(+), 98 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index e890a5d..95fcac9 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -561,7 +561,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t v= al) uint16_t sus_typ =3D (val >> 10) & 7; switch(sus_typ) { case 0: /* soft power off */ - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); break; case 1: qemu_system_suspend_request(); @@ -569,7 +569,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t v= al) default: if (sus_typ =3D=3D ar->pm1.cnt.s4_val) { /* S4 request */ qapi_event_send_suspend_disk(&error_abort); - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN= ); } break; } diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 0a4508c..d209b97 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -108,9 +108,9 @@ static void hb_regs_write(void *opaque, hwaddr offset, =20 if (offset =3D=3D 0xf00) { if (value =3D=3D 1 || value =3D=3D 2) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } else if (value =3D=3D 3) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } } =20 diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 5610ffc..ca3eca1 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -158,7 +158,7 @@ static void integratorcm_do_remap(IntegratorCMState *s) static void integratorcm_set_ctrl(IntegratorCMState *s, uint32_t value) { if (value & 8) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } if ((s->cm_ctrl ^ value) & 1) { /* (value & 1) !=3D 0 means the green "MISC LED" is lit. diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index cbbca4e..9c710f7 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -898,7 +898,7 @@ static void mv88w8618_pit_write(void *opaque, hwaddr of= fset, =20 case MP_BOARD_RESET: if (value =3D=3D MP_BOARD_RESET_MAGIC) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; } diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index b3cf0ec..54582bd 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -355,7 +355,7 @@ static void omap_wd_timer_write(void *opaque, hwaddr ad= dr, /* XXX: on T|E hardware somehow this has no effect, * on Zire 71 it works as specified. */ s->reset =3D 1; - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } s->last_wr =3D value & 0xff; @@ -1545,8 +1545,10 @@ static inline void omap_clkm_idlect1_update(struct o= map_mpu_state_s *s, if (value & (1 << 11)) { /* SETARM_IDLE */ cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_HALT); } - if (!(value & (1 << 10))) /* WKUP_MODE */ - qemu_system_shutdown_request(); /* XXX: disable wakeup from IRQ */ + if (!(value & (1 << 10))) { /* WKUP_MODE */ + /* XXX: disable wakeup from IRQ */ + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } =20 #define SET_CANIDLE(clock, bit) \ if (diff & (1 << bit)) { \ @@ -1693,7 +1695,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr, diff =3D s->clkm.arm_rstct1 ^ value; s->clkm.arm_rstct1 =3D value & 0x0007; if (value & 9) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); s->clkm.cold_start =3D 0xa; } if (diff & ~value & 4) { /* DSP_RST */ diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index cf1b4ba..8afb854 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -1610,7 +1610,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x450: /* RM_RSTCTRL_WKUP */ /* TODO: reset */ if (value & 2) - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); break; case 0x454: /* RM_RSTTIME_WKUP */ s->rsttime_wkup =3D value & 0x1fff; diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 3246268..93bde14 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -848,7 +848,7 @@ static void spitz_lcd_hsync_handler(void *opaque, int l= ine, int level) static void spitz_reset(void *opaque, int line, int level) { if (level) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } =20 diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index ea7a809..cf6e7be 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1197,7 +1197,7 @@ static void do_sys_reset(void *opaque, int n, int level) { if (level) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } =20 diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 9f58a23..2421b81 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -90,7 +90,7 @@ static void tosa_out_switch(void *opaque, int line, int l= evel) static void tosa_reset(void *opaque, int line, int level) { if (level) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 816bfa8..107a341 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -519,7 +519,7 @@ static void port92_write(void *opaque, hwaddr addr, uin= t64_t val, s->outport =3D val; qemu_set_irq(s->a20_out, (val >> 1) & 1); if ((val & 1) && !(oldval & 1)) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } =20 diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 222d89a..919f09b 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1398,7 +1398,7 @@ void xen_shutdown_fatal_error(const char *fmt, ...) va_end(ap); fprintf(stderr, "Will destroy the domain.\n"); /* destroy the domain */ - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); } =20 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index d414288..c479f82 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -226,7 +226,7 @@ static void outport_write(KBDState *s, uint32_t val) s->outport =3D val; qemu_set_irq(s->a20_out, (val >> 1) & 1); if (!(val & 1)) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } =20 @@ -301,7 +301,7 @@ static void kbd_write_command(void *opaque, hwaddr addr, s->outport &=3D ~KBD_OUT_A20; break; case KBD_CCMD_RESET: - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); break; case KBD_CCMD_NO_OP: /* ignore that */ diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index 5cf1caa..afafe14 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -44,14 +44,14 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op= op, int checkonly) if (checkonly) { return 0; } - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return 0; =20 case IPMI_POWEROFF_CHASSIS: if (checkonly) { return 0; } - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); return 0; =20 case IPMI_SEND_NMI: diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index e2215dc..ac8416d 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -606,7 +606,7 @@ static void ich9_rst_cnt_write(void *opaque, hwaddr add= r, uint64_t val, ICH9LPCState *lpc =3D opaque; =20 if (val & 4) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return; } lpc->rst_cnt =3D val & 0xA; /* keep FULL_RST (bit 3) and SYS_RST (bit = 1) */ diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 83f7b82..53d1e0c 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -232,7 +232,7 @@ static void boston_platreg_write(void *opaque, hwaddr a= ddr, break; case PLAT_SOFTRST_CTL: if (val & PLAT_SOFTRST_CTL_SYSRESET) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; default: diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 5dd177e..7814c39 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -470,7 +470,7 @@ static void malta_fpga_write(void *opaque, hwaddr addr, /* SOFTRES Register */ case 0x00500: if (val =3D=3D 0x42) - qemu_system_reset_request (); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); break; =20 /* BRKRES Register */ diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 748586e..f4de9fc 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -53,9 +53,9 @@ static void mips_qemu_write (void *opaque, hwaddr addr, uint64_t val, unsigned size) { if ((addr & 0xffff) =3D=3D 0 && val =3D=3D 42) - qemu_system_reset_request (); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); else if ((addr & 0xffff) =3D=3D 4 && val =3D=3D 42) - qemu_system_shutdown_request (); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } =20 static uint64_t mips_qemu_read (void *opaque, hwaddr addr, diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index 8524008..b20b44e 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -351,13 +351,13 @@ static bool vexpress_cfgctrl_write(arm_sysctl_state *= s, unsigned int dcc, break; case SYS_CFG_SHUTDOWN: if (site =3D=3D SYS_CFG_SITE_MB && device =3D=3D 0) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); return true; } break; case SYS_CFG_REBOOT: if (site =3D=3D SYS_CFG_SITE_MB && device =3D=3D 0) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return true; } break; @@ -429,7 +429,7 @@ static void arm_sysctl_write(void *opaque, hwaddr offse= t, if (s->lockval =3D=3D LOCK_VALUE) { s->resetlevel =3D val; if (val & 0x100) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } break; @@ -438,7 +438,7 @@ static void arm_sysctl_write(void *opaque, hwaddr offse= t, if (s->lockval =3D=3D LOCK_VALUE) { s->resetlevel =3D val; if (val & 0x04) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } break; diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c index 0c207e3..677274c 100644 --- a/hw/misc/cbus.c +++ b/hw/misc/cbus.c @@ -356,7 +356,7 @@ static inline void retu_write(CBusRetu *s, int reg, uin= t16_t val) =20 case RETU_REG_WATCHDOG: if (val =3D=3D 0 && (s->cc[0] & 2)) - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); break; =20 case RETU_REG_TXCR: diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 05c02fb..008d8bd 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -612,7 +612,7 @@ static bool cuda_cmd_powerdown(CUDAState *s, return false; } =20 - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); return true; } =20 @@ -624,7 +624,7 @@ static bool cuda_cmd_reset_system(CUDAState *s, return false; } =20 - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return true; } =20 diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c index edd5de0..18ff677 100644 --- a/hw/misc/slavio_misc.c +++ b/hw/misc/slavio_misc.c @@ -258,7 +258,7 @@ static void slavio_aux2_mem_writeb(void *opaque, hwaddr= addr, val &=3D AUX2_PWROFF; s->aux2 =3D val; if (val & AUX2_PWROFF) - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); slavio_misc_update_irq(s); } =20 @@ -338,7 +338,7 @@ static void slavio_sysctrl_mem_writel(void *opaque, hwa= ddr addr, case 0: if (val & SYS_RESET) { s->sysctrl =3D SYS_RESETSTAT; - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; default: diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c index 7891219..44304d4 100644 --- a/hw/misc/zynq_slcr.c +++ b/hw/misc/zynq_slcr.c @@ -405,7 +405,7 @@ static void zynq_slcr_write(void *opaque, hwaddr offset, switch (offset) { case PSS_RST_CTRL: if (val & R_PSS_RST_CTRL_SOFT_RST) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; } diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c index edc88f4..f04104c 100644 --- a/hw/pci-host/apb.c +++ b/hw/pci-host/apb.c @@ -482,9 +482,9 @@ static void apb_config_writel (void *opaque, hwaddr add= r, s->reset_control |=3D val & RESET_WMASK; if (val & SOFT_POR) { s->nr_resets =3D 0; - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } else if (val & SOFT_XIR) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } break; diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 85a3bb0..89133a9 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -269,7 +269,7 @@ static void bonito_writel(void *opaque, hwaddr addr, } s->regs[saddr] =3D val; if (reset) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; case BONITO_INTENSET: diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 2d02de1..4ce201e 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -632,7 +632,7 @@ static void rcr_write(void *opaque, hwaddr addr, uint64= _t val, unsigned len) PIIX3State *d =3D opaque; =20 if (val & 4) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return; } d->rcr =3D val & 2; /* keep System Reset type only */ diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index f7df238..62f1857 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -774,7 +774,7 @@ static qemu_irq *ppce500_init_mpic(MachineState *machin= e, PPCE500Params *params, static void ppce500_power_off(void *opaque, int line, int on) { if (on) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } } =20 diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index ba69178..ce1254b 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -98,7 +98,7 @@ static void mpc8544_guts_write(void *opaque, hwaddr addr, switch (addr) { case MPC8544_GUTS_ADDR_RSTCR: if (value & MPC8544_GUTS_RSTCR_RESET) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; default: diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 5f93083..224184d 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -412,7 +412,7 @@ static void ppce500_set_irq(void *opaque, int pin, int = level) if (level) { LOG_IRQ("%s: reset the PowerPC system\n", __func__); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; case PPCE500_INPUT_RESET_CORE: diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c index d5df94a..fc32e96 100644 --- a/hw/ppc/ppc405_uc.c +++ b/hw/ppc/ppc405_uc.c @@ -1807,7 +1807,7 @@ void ppc40x_chip_reset(PowerPCCPU *cpu) void ppc40x_system_reset(PowerPCCPU *cpu) { printf("Reset PowerPC system\n"); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } =20 void store_40x_dbcr0 (CPUPPCState *env, uint32_t val) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 0d608d6..49a83ee 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1162,7 +1162,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, spapr_ovec_cleanup(ov5_updates); =20 if (spapr->cas_reboot) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } else { /* If ppc_spapr_reset() did not set up a HPT but one is necessary * (because the guest isn't going to use radix) then set it up her= e. */ diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 619f32c..128d993 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -110,7 +110,7 @@ static void rtas_power_off(PowerPCCPU *cpu, sPAPRMachin= eState *spapr, rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); return; } - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); cpu_stop_current(); rtas_st(rets, 0, RTAS_OUT_SUCCESS); } @@ -124,7 +124,7 @@ static void rtas_system_reboot(PowerPCCPU *cpu, sPAPRMa= chineState *spapr, rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); return; } - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); rtas_st(rets, 0, RTAS_OUT_SUCCESS); } =20 diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 75d3c68..4e6469d 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -396,7 +396,7 @@ void s390_reipl_request(void) S390IPLState *ipl =3D get_ipl_device(); =20 ipl->reipl_requested =3D true; - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } =20 void s390_ipl_prepare_cpu(S390CPU *cpu) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 8f520ce..e6fc74e 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -164,7 +164,7 @@ r2d_fpga_write(void *opaque, hwaddr addr, uint64_t valu= e, unsigned int size) break; case PA_POWOFF: if (value & 1) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } break; case PA_VERREG: diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index 8e18236..d13bc30 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -207,7 +207,7 @@ static void watchdog_hit(void *opaque) qemu_irq_raise(t->nmi); } else - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); =20 t->wd_hits++; } diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c index 474981a..4a064fb 100644 --- a/hw/timer/m48t59.c +++ b/hw/timer/m48t59.c @@ -1,7 +1,7 @@ /* * QEMU M48T59 and M48T08 NVRAM emulation for PPC PREP and Sparc platforms * - * Copyright (c) 2003-2005, 2007 Jocelyn Mayer + * Copyright (c) 2003-2005, 2007, 2017 Jocelyn Mayer * Copyright (c) 2013 Herv=C3=A9 Poussineau * * Permission is hereby granted, free of charge, to any person obtaining a= copy @@ -159,7 +159,7 @@ static void watchdog_cb (void *opaque) NVRAM->buffer[0x1FF7] =3D 0x00; NVRAM->buffer[0x1FFC] &=3D ~0x40; /* May it be a hw CPU Reset instead ? */ - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } else { qemu_set_irq(NVRAM->IRQ, 1); qemu_set_irq(NVRAM->IRQ, 0); diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c index 4488590..93bc6e17 100644 --- a/hw/timer/milkymist-sysctl.c +++ b/hw/timer/milkymist-sysctl.c @@ -90,7 +90,7 @@ static void sysctl_icap_write(MilkymistSysctlState *s, ui= nt32_t value) trace_milkymist_sysctl_icap_write(value); switch (value & 0xffff) { case 0x000e: - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); break; } } @@ -195,7 +195,7 @@ static void sysctl_write(void *opaque, hwaddr addr, uin= t64_t value, s->regs[addr] =3D 1; break; case R_SYSTEM_ID: - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); break; =20 case R_GPIO_IN: diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c index 59002b4..68ba5a7 100644 --- a/hw/timer/pxa2xx_timer.c +++ b/hw/timer/pxa2xx_timer.c @@ -401,7 +401,7 @@ static void pxa2xx_timer_tick(void *opaque) if (t->num =3D=3D 3) if (i->reset3 & 1) { i->reset3 =3D 0; - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } } =20 diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 2aeaf1f..0c5c9cd 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -110,7 +110,7 @@ void watchdog_perform_action(void) switch (watchdog_action) { case WDT_RESET: /* same as 'system_reset' in monitor */ qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_RESET, &error_= abort); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); break; =20 case WDT_SHUTDOWN: /* same as 'system_powerdown' in monitor */ diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index 457a897..c89ced2 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -148,7 +148,7 @@ static void xen_domain_poll(void *opaque) return; =20 quit: - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } =20 static int xen_domain_watcher(void) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 11176e2..4636f8e 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -100,7 +100,7 @@ static void lx60_fpga_write(void *opaque, hwaddr addr, =20 case 0x10: /*board reset*/ if (val =3D=3D 0xdead) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } break; } diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index ba633d7..58e54ee 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -62,13 +62,13 @@ typedef enum WakeupReason { QEMU_WAKEUP_REASON_OTHER, } WakeupReason; =20 -void qemu_system_reset_request(void); +void qemu_system_reset_request(ShutdownCause reason); void qemu_system_suspend_request(void); void qemu_register_suspend_notifier(Notifier *notifier); void qemu_system_wakeup_request(WakeupReason reason); void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); void qemu_register_wakeup_notifier(Notifier *notifier); -void qemu_system_shutdown_request(void); +void qemu_system_shutdown_request(ShutdownCause reason); void qemu_system_powerdown_request(void); void qemu_register_powerdown_notifier(Notifier *notifier); void qemu_system_debug_request(void); diff --git a/kvm-all.c b/kvm-all.c index 90b8573..7df27c8 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -2052,7 +2052,7 @@ int kvm_cpu_exec(CPUState *cpu) break; case KVM_EXIT_SHUTDOWN: DPRINTF("shutdown\n"); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); ret =3D EXCP_INTERRUPT; break; case KVM_EXIT_UNKNOWN: @@ -2066,11 +2066,11 @@ int kvm_cpu_exec(CPUState *cpu) case KVM_EXIT_SYSTEM_EVENT: switch (run->system_event.type) { case KVM_SYSTEM_EVENT_SHUTDOWN: - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN= ); ret =3D EXCP_INTERRUPT; break; case KVM_SYSTEM_EVENT_RESET: - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); ret =3D EXCP_INTERRUPT; break; case KVM_SYSTEM_EVENT_CRASH: diff --git a/os-win32.c b/os-win32.c index ae98574..586a7c7 100644 --- a/os-win32.c +++ b/os-win32.c @@ -52,7 +52,7 @@ int setenv(const char *name, const char *value, int overw= rite) =20 static BOOL WINAPI qemu_ctrl_handler(DWORD type) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_SIGNAL); /* Windows 7 kills application when the function returns. Sleep here to give QEMU a try for closing. Sleep period is 10000ms because Windows kills the program diff --git a/qmp.c b/qmp.c index f656940..84638e2 100644 --- a/qmp.c +++ b/qmp.c @@ -84,7 +84,7 @@ UuidInfo *qmp_query_uuid(Error **errp) void qmp_quit(Error **errp) { no_shutdown =3D 0; - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP); } =20 void qmp_stop(Error **errp) @@ -105,7 +105,7 @@ void qmp_stop(Error **errp) =20 void qmp_system_reset(Error **errp) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP); } =20 void qmp_system_powerdown(Error **erp) diff --git a/replay/replay.c b/replay/replay.c index bf94e81..ff58a5a 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -51,8 +51,8 @@ bool replay_next_event_is(int event) switch (replay_state.data_kind) { case EVENT_SHUTDOWN ... EVENT_SHUTDOWN_LAST: replay_finish_event(); - /* TODO - pass replay_state.data_kind - EVENT_SHUTDOWN as caus= e */ - qemu_system_shutdown_request(); + qemu_system_shutdown_request(replay_state.data_kind - + EVENT_SHUTDOWN); break; default: /* clock, time_t, checkpoint and other events */ diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c index 652195d..ac22323 100644 --- a/target/alpha/sys_helper.c +++ b/target/alpha/sys_helper.c @@ -60,9 +60,9 @@ void helper_tb_flush(CPUAlphaState *env) void helper_halt(uint64_t restart) { if (restart) { - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); } else { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } } =20 diff --git a/target/arm/psci.c b/target/arm/psci.c index ade9fe2..fc34b26 100644 --- a/target/arm/psci.c +++ b/target/arm/psci.c @@ -137,7 +137,7 @@ void arm_handle_psci_call(ARMCPU *cpu) } break; case QEMU_PSCI_0_2_FN_SYSTEM_RESET: - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); /* QEMU reset and shutdown are async requests, but PSCI * mandates that we never return from the reset/shutdown * call, so power the CPU off now so it doesn't execute @@ -145,7 +145,7 @@ void arm_handle_psci_call(ARMCPU *cpu) */ goto cpu_off; case QEMU_PSCI_0_2_FN_SYSTEM_OFF: - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); goto cpu_off; case QEMU_PSCI_0_1_FN_CPU_ON: case QEMU_PSCI_0_2_FN_CPU_ON: diff --git a/target/i386/excp_helper.c b/target/i386/excp_helper.c index ee596c6..b769772 100644 --- a/target/i386/excp_helper.c +++ b/target/i386/excp_helper.c @@ -59,7 +59,7 @@ static int check_exception(CPUX86State *env, int intno, i= nt *error_code, =20 qemu_log_mask(CPU_LOG_RESET, "Triple fault\n"); =20 - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return EXCP_HLT; } #endif diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index ef13015..7346931 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -540,14 +540,14 @@ static int hax_vcpu_hax_exec(CPUArchState *env) /* Guest state changed, currently only for shutdown */ case HAX_EXIT_STATECHANGE: fprintf(stdout, "VCPU shutdown request\n"); - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); hax_vcpu_sync_state(env, 0); ret =3D 1; break; case HAX_EXIT_UNKNOWN_VMEXIT: fprintf(stderr, "Unknown VMX exit %x from guest\n", ht->_exit_reason); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); hax_vcpu_sync_state(env, 0); cpu_dump_state(cpu, stderr, fprintf, 0); ret =3D -1; @@ -578,7 +578,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) break; default: fprintf(stderr, "Unknown exit %x from HAX\n", ht->_exit_status= ); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); hax_vcpu_sync_state(env, 0); cpu_dump_state(cpu, stderr, fprintf, 0); ret =3D 1; diff --git a/target/i386/helper.c b/target/i386/helper.c index f11cac6..ee7eff2 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -1212,7 +1212,7 @@ static void do_inject_x86_mce(CPUState *cs, run_on_cp= u_data data) " triple fault\n", cs->cpu_index); qemu_log_mask(CPU_LOG_RESET, "Triple fault\n"); - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); return; } if (banks[1] & MCI_STATUS_VAL) { diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 011d4a5..49b6115 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2930,7 +2930,7 @@ int kvm_arch_process_async_events(CPUState *cs) =20 if (env->exception_injected =3D=3D EXCP08_DBLE) { /* this means triple fault */ - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); cs->exit_request =3D 1; return 0; } diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 9978490..4f8aadf 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -266,7 +266,7 @@ void load_psw(CPUS390XState *env, uint64_t mask, uint64= _t addr) S390CPU *cpu =3D s390_env_get_cpu(env); if (s390_cpu_halt(cpu) =3D=3D 0) { #ifndef CONFIG_USER_ONLY - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); #endif } } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index fb10542..ba1e60f 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1927,7 +1927,7 @@ static int handle_intercept(S390CPU *cpu) cpu_synchronize_state(cs); if (s390_cpu_halt(cpu) =3D=3D 0) { if (is_special_wait_psw(cs)) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUT= DOWN); } else { qemu_system_guest_panicked(NULL); } @@ -1936,7 +1936,7 @@ static int handle_intercept(S390CPU *cpu) break; case ICPT_CPU_STOP: if (s390_cpu_set_state(CPU_STATE_STOPPED, cpu) =3D=3D 0) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN= ); } if (cpu->env.sigp_order =3D=3D SIGP_STOP_STORE_STATUS) { kvm_s390_store_status(cpu, KVM_S390_STORE_STATUS_DEF_ADDR, diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index 23ec52c..1b9f448 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -532,11 +532,11 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t or= der_code, uint32_t r1, break; #if !defined(CONFIG_USER_ONLY) case SIGP_RESTART: - qemu_system_reset_request(); + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); cpu_loop_exit(CPU(s390_env_get_cpu(env))); break; case SIGP_STOP: - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); cpu_loop_exit(CPU(s390_env_get_cpu(env))); break; #endif diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index 09afe13..eec9a4d 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -109,7 +109,7 @@ void sparc_cpu_do_interrupt(CPUState *cs) if (env->psret =3D=3D 0) { if (cs->exception_index =3D=3D 0x80 && env->def->features & CPU_FEATURE_TA0_SHUTDOWN) { - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } else { cpu_abort(cs, "Trap 0x%02x while interrupts disabled, Error st= ate", cs->exception_index); diff --git a/trace-events b/trace-events index e582d63..433865f 100644 --- a/trace-events +++ b/trace-events @@ -38,7 +38,7 @@ vm_state_notify(int running, int reason) "running %d reas= on %d" load_file(const char *name, const char *path) "name %s location %s" runstate_set(int new_state) "new state %d" system_wakeup_request(int reason) "reason=3D%d" -qemu_system_shutdown_request(void) "" +qemu_system_shutdown_request(int reason) "reason=3D%d" qemu_system_powerdown_request(void) "" =20 # spice-qemu-char.c diff --git a/ui/cocoa.m b/ui/cocoa.m index 3a9bc4d..004ec27 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -934,7 +934,7 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaAppController: applicationWillTerminate\n"); =20 - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); exit(0); } =20 diff --git a/ui/sdl.c b/ui/sdl.c index b35a678..7b71a9a 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -837,7 +837,7 @@ static void sdl_refresh(DisplayChangeListener *dcl) case SDL_QUIT: if (!no_quit) { no_shutdown =3D 0; - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } break; case SDL_MOUSEMOTION: diff --git a/ui/sdl2.c b/ui/sdl2.c index 21de052..f76ee10 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -568,7 +568,7 @@ static void handle_windowevent(SDL_Event *ev) case SDL_WINDOWEVENT_CLOSE: if (!no_quit) { no_shutdown =3D 0; - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } break; case SDL_WINDOWEVENT_SHOWN: @@ -611,7 +611,7 @@ void sdl2_poll_events(struct sdl2_console *scon) case SDL_QUIT: if (!no_quit) { no_shutdown =3D 0; - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } break; case SDL_MOUSEMOTION: diff --git a/vl.c b/vl.c index 909519f..1064fd1 100644 --- a/vl.c +++ b/vl.c @@ -1724,7 +1724,7 @@ void qemu_system_guest_panicked(GuestPanicInformation= *info) if (!no_shutdown) { qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_POWEROFF, !!info, info, &error_abort); - qemu_system_shutdown_request(); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_PANIC); } =20 if (info) { @@ -1741,13 +1741,12 @@ void qemu_system_guest_panicked(GuestPanicInformati= on *info) } } =20 -void qemu_system_reset_request(void) +void qemu_system_reset_request(ShutdownCause reason) { if (no_reboot) { - /* TODO - add a parameter to allow callers to specify reason */ - shutdown_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; + shutdown_requested =3D reason; } else { - reset_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; + reset_requested =3D reason; } cpu_stop_current(); qemu_notify_event(); @@ -1818,12 +1817,11 @@ void qemu_system_killed(int signal, pid_t pid) qemu_notify_event(); } =20 -void qemu_system_shutdown_request(void) +void qemu_system_shutdown_request(ShutdownCause reason) { - trace_qemu_system_shutdown_request(); - /* TODO - add a parameter to allow callers to specify reason */ - replay_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); - shutdown_requested =3D SHUTDOWN_CAUSE_HOST_ERROR; + trace_qemu_system_shutdown_request(reason); + replay_shutdown_request(reason); + shutdown_requested =3D reason; qemu_notify_event(); } =20 --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495543061957987.7385353370169; Tue, 23 May 2017 05:37:41 -0700 (PDT) Received: from localhost ([::1]:48788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD94F-0002LI-0d for importer@patchew.org; Tue, 23 May 2017 08:37:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xa-0005l9-7g for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xX-000158-Vs for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38570) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xX-00014G-NV for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB7E717AC78 for ; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 00D705C8A1; Tue, 23 May 2017 12:30:41 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E57D111386CE; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BB7E717AC78 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BB7E717AC78 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:36 +0200 Message-Id: <1495542638-12335-8-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 23 May 2017 12:30:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] shutdown: Expose bool cause in SHUTDOWN and RESET events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Libvirt would like to be able to distinguish between a SHUTDOWN event triggered solely by guest request and one triggered by a SIGTERM or other action on the host. While qemu_kill_report() was already able to give different output to stderr based on whether a shutdown was triggered by a host signal (but NOT by a host UI event, such as clicking the X on the window), that information was then lost to management. The previous patches improved things to use an enum throughout all callsites, so now we have something ready to expose through QMP. Note that for now, the decision was to expose ONLY a boolean, rather than promoting ShutdownCause to a QAPI enum; this is because libvirt has not expressed an interest in anything finer-grained. We can still add additional details, in a backwards-compatible manner, if a need later arises (if the addition happens before 2.10, we can replace the bool with an enum; otherwise, the enum will have to be in addition to the bool); this patch merely adds a helper shutdown_caused_by_guest() to map the internal enum into the external boolean. Update expected iotest outputs to match the new data (complete coverage of the affected tests is obtained by -raw, -qcow2, and -nbd). Here is output from 'virsh qemu-monitor-event --loop' with the patch installed: event SHUTDOWN at 1492639680.731251 for domain fedora_13: {"guest":true} event STOP at 1492639680.732116 for domain fedora_13: event SHUTDOWN at 1492639680.732830 for domain fedora_13: {"guest":false} Note that libvirt runs qemu with -no-shutdown: the first SHUTDOWN event was triggered by an action I took directly in the guest (shutdown -h), at which point qemu stops the vcpus and waits for libvirt to do any final cleanups; the second SHUTDOWN event is the result of libvirt sending SIGTERM now that it has completed cleanup. Libvirt is already smart enough to only feed the first qemu SHUTDOWN event to the end user (remember, virsh qemu-monitor-event is a low-level debugging interface that is explicitly unsupported by libvirt, so it sees things that normal end users do not); changing qemu to emit SHUTDOWN only once is outside the scope of this series. See also https://bugzilla.redhat.com/1384007 Signed-off-by: Eric Blake Message-Id: <20170515214114.15442-6-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/sysemu/sysemu.h | 5 +++++ qapi/event.json | 17 +++++++++++++---- tests/qemu-iotests/071.out | 4 ++-- tests/qemu-iotests/081.out | 2 +- tests/qemu-iotests/087.out | 12 ++++++------ tests/qemu-iotests/094.out | 2 +- tests/qemu-iotests/117.out | 2 +- tests/qemu-iotests/119.out | 2 +- tests/qemu-iotests/120.out | 2 +- tests/qemu-iotests/140.out | 2 +- tests/qemu-iotests/143.out | 2 +- tests/qemu-iotests/156.out | 2 +- vl.c | 8 ++++---- 13 files changed, 38 insertions(+), 24 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 58e54ee..a86b8cf 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -49,6 +49,11 @@ typedef enum ShutdownCause { SHUTDOWN_CAUSE__MAX, } ShutdownCause; =20 +static inline bool shutdown_caused_by_guest(ShutdownCause cause) +{ + return cause >=3D SHUTDOWN_CAUSE_GUEST_SHUTDOWN; +} + void vm_start(void); int vm_prepare_start(void); int vm_stop(RunState state); diff --git a/qapi/event.json b/qapi/event.json index e80f3f4..6d22b02 100644 --- a/qapi/event.json +++ b/qapi/event.json @@ -10,6 +10,10 @@ # Emitted when the virtual machine has shut down, indicating that qemu is # about to exit. # +# @guest: If true, the shutdown was triggered by a guest request (such as +# a guest-initiated ACPI shutdown request or other hardware-specific actio= n) +# rather than a host request (such as sending qemu a SIGINT). (since 2.10) +# # Note: If the command-line option "-no-shutdown" has been specified, qemu= will # not exit, and a STOP event will eventually follow the SHUTDOWN event # @@ -17,11 +21,11 @@ # # Example: # -# <- { "event": "SHUTDOWN", +# <- { "event": "SHUTDOWN", "data": { "guest": true }, # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } } # ## -{ 'event': 'SHUTDOWN' } +{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } } =20 ## # @POWERDOWN: @@ -44,15 +48,20 @@ # # Emitted when the virtual machine is reset # +# @guest: If true, the reset was triggered by a guest request (such as +# a guest-initiated ACPI reboot request or other hardware-specific action) +# rather than a host request (such as the QMP command system_reset). +# (since 2.10) +# # Since: 0.12.0 # # Example: # -# <- { "event": "RESET", +# <- { "event": "RESET", "data": { "guest": false }, # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } } # ## -{ 'event': 'RESET' } +{ 'event': 'RESET', 'data': { 'guest': 'bool' } } =20 ## # @STOP: diff --git a/tests/qemu-iotests/071.out b/tests/qemu-iotests/071.out index dd879f1..1d5e28d 100644 --- a/tests/qemu-iotests/071.out +++ b/tests/qemu-iotests/071.out @@ -46,7 +46,7 @@ QMP_VERSION read failed: Input/output error {"return": ""} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 =20 =3D=3D=3D Testing blkverify on existing block device =3D=3D=3D @@ -85,7 +85,7 @@ wrote 512/512 bytes at offset 0 read failed: Input/output error {"return": ""} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} QEMU_PROG: Failed to flush the L2 table cache: Input/output error QEMU_PROG: Failed to flush the refcount block cache: Input/output error =20 diff --git a/tests/qemu-iotests/081.out b/tests/qemu-iotests/081.out index 97df69d..2533c31 100644 --- a/tests/qemu-iotests/081.out +++ b/tests/qemu-iotests/081.out @@ -36,7 +36,7 @@ read 10485760/10485760 bytes at offset 0 10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 =20 =3D=3D using quorum rewrite corrupted mode =3D=3D diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out index dc6baf9..59c5208 100644 --- a/tests/qemu-iotests/087.out +++ b/tests/qemu-iotests/087.out @@ -8,7 +8,7 @@ QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "'node-name' must be specified= for the root node"}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 =20 =3D=3D=3D Duplicate ID =3D=3D=3D @@ -19,7 +19,7 @@ QMP_VERSION {"error": {"class": "GenericError", "desc": "node-name=3Ddisk is conflicti= ng with a device id"}} {"error": {"class": "GenericError", "desc": "Duplicate node name"}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 =20 =3D=3D=3D aio=3Dnative without O_DIRECT =3D=3D=3D @@ -29,7 +29,7 @@ QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "aio=3Dnative was specified, b= ut it requires cache.direct=3Don, which was not specified."}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 =20 =3D=3D=3D Encrypted image =3D=3D=3D @@ -40,14 +40,14 @@ QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "Use of AES-CBC encrypted IMGF= MT images is no longer supported in system emulators"}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 Testing: QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "Use of AES-CBC encrypted IMGF= MT images is no longer supported in system emulators"}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 =20 =3D=3D=3D Missing driver =3D=3D=3D @@ -58,6 +58,6 @@ QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "Parameter 'driver' is missing= "}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 *** done diff --git a/tests/qemu-iotests/094.out b/tests/qemu-iotests/094.out index b66dc07..f52baff 100644 --- a/tests/qemu-iotests/094.out +++ b/tests/qemu-iotests/094.out @@ -7,5 +7,5 @@ Formatting 'TEST_DIR/source.IMGFMT', fmt=3DIMGFMT size=3D67= 108864 {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 67108864, "offset= ": 67108864, "speed": 0, "type": "mirror"}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done diff --git a/tests/qemu-iotests/117.out b/tests/qemu-iotests/117.out index f52dc1a..851e214 100644 --- a/tests/qemu-iotests/117.out +++ b/tests/qemu-iotests/117.out @@ -7,7 +7,7 @@ wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} No errors were found on the image. read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/119.out b/tests/qemu-iotests/119.out index 58e7114..a8743b8 100644 --- a/tests/qemu-iotests/119.out +++ b/tests/qemu-iotests/119.out @@ -6,6 +6,6 @@ read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 *** done diff --git a/tests/qemu-iotests/120.out b/tests/qemu-iotests/120.out index 9131b1b..1af1aeb 100644 --- a/tests/qemu-iotests/120.out +++ b/tests/qemu-iotests/120.out @@ -6,7 +6,7 @@ wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 65536/65536 bytes at offset 0 diff --git a/tests/qemu-iotests/140.out b/tests/qemu-iotests/140.out index 6c04456..0689b2b 100644 --- a/tests/qemu-iotests/140.out +++ b/tests/qemu-iotests/140.out @@ -10,5 +10,5 @@ read 65536/65536 bytes at offset 0 {"return": {}} can't open device nbd+unix:///drv?socket=3DTEST_DIR/nbd: No export with na= me 'drv' available {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out index d24ad20..0978b89 100644 --- a/tests/qemu-iotests/143.out +++ b/tests/qemu-iotests/143.out @@ -3,5 +3,5 @@ QA output created by 143 {"return": {}} can't open device nbd+unix:///no_such_export?socket=3DTEST_DIR/nbd: No exp= ort with name 'no_such_export' available {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done diff --git a/tests/qemu-iotests/156.out b/tests/qemu-iotests/156.out index 3af82ae..f96a564 100644 --- a/tests/qemu-iotests/156.out +++ b/tests/qemu-iotests/156.out @@ -34,7 +34,7 @@ read 65536/65536 bytes at offset 196608 {"return": ""} =20 {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN"} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} =20 read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/vl.c b/vl.c index 1064fd1..25e1fb4 100644 --- a/vl.c +++ b/vl.c @@ -1705,8 +1705,8 @@ void qemu_system_reset(ShutdownCause reason) qemu_devices_reset(); } if (reason) { - /* TODO update event based on reason */ - qapi_event_send_reset(&error_abort); + qapi_event_send_reset(shutdown_caused_by_guest(reason), + &error_abort); } cpu_synchronize_all_post_reset(); } @@ -1863,8 +1863,8 @@ static bool main_loop_should_exit(void) request =3D qemu_shutdown_requested(); if (request) { qemu_kill_report(); - /* TODO update event based on request */ - qapi_event_send_shutdown(&error_abort); + qapi_event_send_shutdown(shutdown_caused_by_guest(request), + &error_abort); if (no_shutdown) { vm_stop(RUN_STATE_SHUTDOWN); } else { --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14955427372601002.0748294534177; Tue, 23 May 2017 05:32:17 -0700 (PDT) Received: from localhost ([::1]:48761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8yz-0006cD-JO for importer@patchew.org; Tue, 23 May 2017 08:32:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xZ-0005ku-52 for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xX-00014a-EM for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xX-00013g-5n for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:43 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33FA080C0F for ; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0038B7814F; Tue, 23 May 2017 12:30:41 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E868E11386DC; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 33FA080C0F Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 33FA080C0F From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:37 +0200 Message-Id: <1495542638-12335-9-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 May 2017 12:30:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] block: Use QDict helpers for --force-share X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Fam's addition of --force-share in commits 459571f7 and 335e9937 were developed prior to the addition of QDict scalar insertion macros, but merged after the general cleanup in commit 46f5ac20. Patch created mechanically by rerunning: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir . --in-place Signed-off-by: Eric Blake Message-Id: <20170515195439.17677-1-eblake@redhat.com> Reviewed-by: Fam Zheng Signed-off-by: Markus Armbruster --- qemu-img.c | 7 +++---- qemu-io.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index b506839..60f1784 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -296,7 +296,7 @@ static BlockBackend *img_open_opts(const char *optstr, error_report("--force-share/-U conflicts with image options"); return NULL; } - qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true)); + qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } blk =3D blk_new_open(NULL, NULL, options, flags, &local_err); if (!blk) { @@ -326,7 +326,7 @@ static BlockBackend *img_open_file(const char *filename, } =20 if (force_share) { - qdict_put(options, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true)); + qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } blk =3D blk_new_open(filename, NULL, options, flags, &local_err); if (!blk) { @@ -3156,8 +3156,7 @@ static int img_rebase(int argc, char **argv) if (!options) { options =3D qdict_new(); } - qdict_put(options, BDRV_OPT_FORCE_SHARE, - qbool_from_bool(true)); + qdict_put_bool(options, BDRV_OPT_FORCE_SHARE, true); } bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name)); blk_old_backing =3D blk_new_open(backing_name, NULL, diff --git a/qemu-io.c b/qemu-io.c index 34fa8a1..8e38b28 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -76,7 +76,7 @@ static int openfile(char *name, int flags, bool writethro= ugh, bool force_share, QDECREF(opts); return 1; } - qdict_put(opts, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true)); + qdict_put_bool(opts, BDRV_OPT_FORCE_SHARE, true); } qemuio_blk =3D blk_new_open(name, NULL, opts, flags, &local_err); if (!qemuio_blk) { --=20 2.7.4 From nobody Thu Mar 28 13:34:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495542736477134.27928002507338; Tue, 23 May 2017 05:32:16 -0700 (PDT) Received: from localhost ([::1]:48762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8yz-0006cV-B0 for importer@patchew.org; Tue, 23 May 2017 08:32:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD8xZ-0005kw-5O for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD8xX-00014h-HS for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39596) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dD8xX-000141-CV for qemu-devel@nongnu.org; Tue, 23 May 2017 08:30:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6769580464 for ; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01DA05C8A5; Tue, 23 May 2017 12:30:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EB4C611385E0; Tue, 23 May 2017 14:30:38 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6769580464 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6769580464 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 23 May 2017 14:30:38 +0200 Message-Id: <1495542638-12335-10-git-send-email-armbru@redhat.com> In-Reply-To: <1495542638-12335-1-git-send-email-armbru@redhat.com> References: <1495542638-12335-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 23 May 2017 12:30:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] qapi-schema: Remove obsolete note from ObjectTypeInfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost The "This command is experimental" note in ObjectTypeInfo is obsolete since 2012. Commit 5192082097549c5b3aa7c913c6853d97a68172cb removed the warning from the qom-list-types command documentation, but we forgot to remove the warning from ObjectTypeInfo. Signed-off-by: Eduardo Habkost Message-Id: <20170516205351.12101-1-ehabkost@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Markus Armbruster --- qapi-schema.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 80603cf..e6da885 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3035,8 +3035,6 @@ # @name: the type name found in the search # # Since: 1.1 -# -# Notes: This command is experimental and may change syntax in future rele= ases. ## { 'struct': 'ObjectTypeInfo', 'data': { 'name': 'str' } } --=20 2.7.4