From nobody Thu Nov 6 00:18:03 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153915212506816.141690733598352; Tue, 9 Oct 2018 23:15:25 -0700 (PDT) Received: from localhost ([::1]:54979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7mG-0004XZ-2A for importer@patchew.org; Wed, 10 Oct 2018 02:15:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7iY-00027p-Lq for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA7iV-0008F4-Nl for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA7iV-00083l-G9 for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:31 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEA3E30820E1 for ; Wed, 10 Oct 2018 06:11:18 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2BDA68C60; Wed, 10 Oct 2018 06:11:14 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3E1AF1132F35; Wed, 10 Oct 2018 08:11:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2018 08:11:09 +0200 Message-Id: <20181010061113.6057-2-armbru@redhat.com> In-Reply-To: <20181010061113.6057-1-armbru@redhat.com> References: <20181010061113.6057-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 10 Oct 2018 06:11:19 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/5] tests/check-qjson: fix a leak 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Spotted by ASAN: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D11893=3D=3DERROR: LeakSanitizer: detected memory leaks Direct leak of 1120 byte(s) in 28 object(s) allocated from: #0 0x7fd0515b0c48 in malloc (/lib64/libasan.so.5+0xeec48) #1 0x7fd050ffa3c5 in g_malloc (/lib64/libglib-2.0.so.0+0x523c5) #2 0x559e708b56a4 in qstring_from_str /home/elmarco/src/qq/qobject/qstr= ing.c:66 #3 0x559e708b4fe0 in qstring_new /home/elmarco/src/qq/qobject/qstring.c= :23 #4 0x559e708bda7d in parse_string /home/elmarco/src/qq/qobject/json-par= ser.c:143 #5 0x559e708c1009 in parse_literal /home/elmarco/src/qq/qobject/json-pa= rser.c:484 #6 0x559e708c1627 in parse_value /home/elmarco/src/qq/qobject/json-pars= er.c:547 #7 0x559e708c1c67 in json_parser_parse /home/elmarco/src/qq/qobject/jso= n-parser.c:573 #8 0x559e708bc0ff in json_message_process_token /home/elmarco/src/qq/qo= bject/json-streamer.c:92 #9 0x559e708d1655 in json_lexer_feed_char /home/elmarco/src/qq/qobject/= json-lexer.c:292 #10 0x559e708d1fe1 in json_lexer_feed /home/elmarco/src/qq/qobject/json= -lexer.c:339 #11 0x559e708bc856 in json_message_parser_feed /home/elmarco/src/qq/qob= ject/json-streamer.c:121 #12 0x559e708b8b4b in qobject_from_jsonv /home/elmarco/src/qq/qobject/q= json.c:69 #13 0x559e708b8d02 in qobject_from_json /home/elmarco/src/qq/qobject/qj= son.c:83 #14 0x559e708a74ae in from_json_str /home/elmarco/src/qq/tests/check-qj= son.c:30 #15 0x559e708a9f83 in utf8_string /home/elmarco/src/qq/tests/check-qjso= n.c:781 #16 0x7fd05101bc49 in test_case_run gtestutils.c:2255 #17 0x7fd05101bc49 in g_test_run_suite_internal gtestutils.c:2339 Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180901211917.10372-1-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/check-qjson.c b/tests/check-qjson.c index cc13f3d41e..d876a7a96e 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -780,6 +780,7 @@ static void utf8_string(void) if (!strstr(json_out, "\\uFFFD")) { str =3D from_json_str(json_out, j, &error_abort); g_assert_cmpstr(qstring_get_try_str(str), =3D=3D, utf8_in); + qobject_unref(str); } } } --=20 2.17.1 From nobody Thu Nov 6 00:18:03 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539152122875739.5645228191614; Tue, 9 Oct 2018 23:15:22 -0700 (PDT) Received: from localhost ([::1]:54978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7mD-0004WL-Qk for importer@patchew.org; Wed, 10 Oct 2018 02:15:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7iY-00027m-LN for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA7iW-0008FN-0I for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA7iV-0007dD-NI for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:31 -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 8D24F88319 for ; Wed, 10 Oct 2018 06:11:15 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2FC617504; Wed, 10 Oct 2018 06:11:14 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 415FB1132D75; Wed, 10 Oct 2018 08:11:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2018 08:11:10 +0200 Message-Id: <20181010061113.6057-3-armbru@redhat.com> In-Reply-To: <20181010061113.6057-1-armbru@redhat.com> References: <20181010061113.6057-1-armbru@redhat.com> MIME-Version: 1.0 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]); Wed, 10 Oct 2018 06:11:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/5] qapi/misc.json: Remove superfluous words in CpuModelExpansionType 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: Kashyap Chamarthy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Kashyap Chamarthy Remove repetition of 'independent of'. While at it, s/QMU/QEMU in @CpuDefinitionInfo. Signed-off-by: Kashyap Chamarthy Message-Id: <20181003104605.8477-1-kchamart@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake Reviewed-by: Eduardo Habkost [Commit message updated as requested by Kashyap] Signed-off-by: Markus Armbruster --- qapi/misc.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index ada9af5add..f98de3a58c 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2017,7 +2017,7 @@ # # @migration-safe: whether a CPU definition can be safely used for # migration in combination with a QEMU compatibility mach= ine -# when migrating between different QMU versions and betwe= en +# when migrating between different QEMU versions and betw= een # hosts with different sets of (hardware or software) # capabilities. If not provided, information is not avail= able # and callers should not assume the CPU definition to be @@ -2126,11 +2126,11 @@ # @static: Expand to a static CPU model, a combination of a static base # model name and property delta changes. As the static base model= will # never change, the expanded CPU model will be the same, independ= ent of -# independent of QEMU version, machine type, machine options, and -# accelerator options. Therefore, the resulting model can be used= by -# tooling without having to specify a compatibility machine - e.g= . when -# displaying the "host" model. static CPU models are migration-sa= fe. -# +# QEMU version, machine type, machine options, and accelerator op= tions. +# Therefore, the resulting model can be used by tooling without h= aving +# to specify a compatibility machine - e.g. when displaying the "= host" +# model. The @static CPU models are migration-safe. + # @full: Expand all properties. The produced model is not guaranteed to be # migration-safe, but allows tooling to get an insight and work with # model details. --=20 2.17.1 From nobody Thu Nov 6 00:18:03 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539152016379265.6429509429936; Tue, 9 Oct 2018 23:13:36 -0700 (PDT) Received: from localhost ([::1]:54970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7kK-00034p-Nu for importer@patchew.org; Wed, 10 Oct 2018 02:13:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7iY-00027n-LO for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA7iV-0008Eo-Gh for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57402) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA7iV-0007dz-8r for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:31 -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 A139AA989 for ; Wed, 10 Oct 2018 06:11:15 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAABA17A63 for ; Wed, 10 Oct 2018 06:11:14 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 451691132D7F; Wed, 10 Oct 2018 08:11:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2018 08:11:11 +0200 Message-Id: <20181010061113.6057-4-armbru@redhat.com> In-Reply-To: <20181010061113.6057-1-armbru@redhat.com> References: <20181010061113.6057-1-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.26]); Wed, 10 Oct 2018 06:11:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/5] tests: Restore check-qdict unit test 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 0bcc8e5bd8d accidentally dropped check-qdict from the list of unit tests (again, see commit 4429532b48a). Put it back, and fix up the test. Signed-off-by: Markus Armbruster Message-Id: <20180926122309.30631-1-armbru@redhat.com> Reviewed-by: Thomas Huth --- tests/Makefile.include | 2 +- tests/check-qdict.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 7a3059bf6c..8264af64a8 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -40,7 +40,7 @@ SYSEMU_TARGET_LIST :=3D $(subst -softmmu.mak,,$(notdir \ =20 check-unit-y =3D tests/check-qdict$(EXESUF) gcov-files-check-qdict-y =3D qobject/qdict.c -check-unit-y =3D tests/check-block-qdict$(EXESUF) +check-unit-y +=3D tests/check-block-qdict$(EXESUF) gcov-files-check-block-qdict-y =3D qobject/block-qdict.c check-unit-y +=3D tests/test-char$(EXESUF) gcov-files-check-qdict-y =3D chardev/char.c diff --git a/tests/check-qdict.c b/tests/check-qdict.c index 86e9fe7dc4..a1e8305066 100644 --- a/tests/check-qdict.c +++ b/tests/check-qdict.c @@ -12,6 +12,8 @@ =20 #include "qemu/osdep.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" +#include "qapi/qmp/qstring.h" =20 /* * Public Interface test-cases --=20 2.17.1 From nobody Thu Nov 6 00:18:03 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539152222357518.1316506809873; Tue, 9 Oct 2018 23:17:02 -0700 (PDT) Received: from localhost ([::1]:54992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7np-0005Ux-Dj for importer@patchew.org; Wed, 10 Oct 2018 02:17:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7iY-00027o-LP for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA7iV-0008FG-VY for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33712) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA7iV-0007dZ-Mq for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:31 -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 82688127AD for ; Wed, 10 Oct 2018 06:11:15 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E30AF77DD8 for ; Wed, 10 Oct 2018 06:11:14 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 488421132D83; Wed, 10 Oct 2018 08:11:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2018 08:11:12 +0200 Message-Id: <20181010061113.6057-5-armbru@redhat.com> In-Reply-To: <20181010061113.6057-1-armbru@redhat.com> References: <20181010061113.6057-1-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.30]); Wed, 10 Oct 2018 06:11:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/5] libqtest: Inline g_assert_no_errno() 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Macro g_assert_no_errno() intrudes into GLib's namespace. It's also pretty pointless. Inline. At one call site, its redundancy is now obvious. Delete it there. Signed-off-by: Markus Armbruster Message-Id: <20180926122933.3858-1-armbru@redhat.com> Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth --- tests/libqtest.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 2cd5736642..44ce118cfc 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -48,10 +48,6 @@ struct QTestState static GHookList abrt_hooks; static struct sigaction sigact_old; =20 -#define g_assert_no_errno(ret) do { \ - g_assert_cmpint(ret, !=3D, -1); \ -} while (0) - static int qtest_query_target_endianness(QTestState *s); =20 static int init_socket(const char *socket_path) @@ -61,7 +57,7 @@ static int init_socket(const char *socket_path) int ret; =20 sock =3D socket(PF_UNIX, SOCK_STREAM, 0); - g_assert_no_errno(sock); + g_assert_cmpint(sock, !=3D, -1); =20 addr.sun_family =3D AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); @@ -70,9 +66,9 @@ static int init_socket(const char *socket_path) do { ret =3D bind(sock, (struct sockaddr *)&addr, sizeof(addr)); } while (ret =3D=3D -1 && errno =3D=3D EINTR); - g_assert_no_errno(ret); + g_assert_cmpint(ret, !=3D, -1); ret =3D listen(sock, 1); - g_assert_no_errno(ret); + g_assert_cmpint(ret, !=3D, -1); =20 return sock; } @@ -325,7 +321,6 @@ static void socket_send(int fd, const char *buf, size_t= size) continue; } =20 - g_assert_no_errno(len); g_assert_cmpint(len, >, 0); =20 offset +=3D len; --=20 2.17.1 From nobody Thu Nov 6 00:18:03 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539152016056958.7282547455633; Tue, 9 Oct 2018 23:13:36 -0700 (PDT) Received: from localhost ([::1]:54969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7kK-00034L-5p for importer@patchew.org; Wed, 10 Oct 2018 02:13:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA7iY-00027l-LJ for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA7iW-0008FU-1j for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56880) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA7iV-0007rZ-Om for qemu-devel@nongnu.org; Wed, 10 Oct 2018 02:11:31 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3934D30001D3 for ; Wed, 10 Oct 2018 06:11:17 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E65411054FBA for ; Wed, 10 Oct 2018 06:11:16 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4CB0C1132D9B; Wed, 10 Oct 2018 08:11:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2018 08:11:13 +0200 Message-Id: <20181010061113.6057-6-armbru@redhat.com> In-Reply-To: <20181010061113.6057-1-armbru@redhat.com> References: <20181010061113.6057-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 10 Oct 2018 06:11:17 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/5] ivshmem: Fix unplug of device "ivshmem-plain" 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit 2aece63c8a "hostmem: detect host backend memory is being used properly" fixed "ivshmem-plain" to reject memory backends that are already in use, and to block their deletion while in use. Two bugs escaped review: * New ivshmem_plain_exit() fails to call ivshmem_exit(). This breaks unplug. Reproducer: migration after unplug still fails with "Migration is disabled when using feature 'peer mode' in device 'ivshmem'". * It failed to update legacy "ivshmem". Harmless, because it creates the memory backend itself, and nothing else should use it. Fix by moving the two host_memory_backend_set_mapped() calls into ivshmem_common_realize() and ivshmem_exit(), guarded by s->hostmem. Fixes: 2aece63c8a9d2c3a8ff41d2febc4cdeff2633331 Signed-off-by: Markus Armbruster Message-Id: <20180926163709.22876-1-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Paolo Bonzini --- hw/misc/ivshmem.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 6febbabcaa..8cb17b9dd4 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -911,6 +911,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Erro= r **errp) IVSHMEM_DPRINTF("using hostmem\n"); =20 s->ivshmem_bar2 =3D host_memory_backend_get_memory(s->hostmem); + host_memory_backend_set_mapped(s->hostmem, true); } else { Chardev *chr =3D qemu_chr_fe_get_driver(&s->server_chr); assert(chr); @@ -993,6 +994,10 @@ static void ivshmem_exit(PCIDevice *dev) vmstate_unregister_ram(s->ivshmem_bar2, DEVICE(dev)); } =20 + if (s->hostmem) { + host_memory_backend_set_mapped(s->hostmem, false); + } + if (s->peers) { for (i =3D 0; i < s->nb_peers; i++) { close_peer_eventfds(s, i); @@ -1101,14 +1106,6 @@ static void ivshmem_plain_realize(PCIDevice *dev, Er= ror **errp) } =20 ivshmem_common_realize(dev, errp); - host_memory_backend_set_mapped(s->hostmem, true); -} - -static void ivshmem_plain_exit(PCIDevice *pci_dev) -{ - IVShmemState *s =3D IVSHMEM_COMMON(pci_dev); - - host_memory_backend_set_mapped(s->hostmem, false); } =20 static void ivshmem_plain_class_init(ObjectClass *klass, void *data) @@ -1117,7 +1114,6 @@ static void ivshmem_plain_class_init(ObjectClass *kla= ss, void *data) PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 k->realize =3D ivshmem_plain_realize; - k->exit =3D ivshmem_plain_exit; dc->props =3D ivshmem_plain_properties; dc->vmsd =3D &ivshmem_plain_vmsd; } --=20 2.17.1