From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608084743225.14815929714666; Fri, 9 Mar 2018 07:08:04 -0800 (PST) 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 4C47A80C32; Fri, 9 Mar 2018 15:08:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B12D082DEC; Fri, 9 Mar 2018 15:08:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 182F4181B9FC; Fri, 9 Mar 2018 15:08:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F80RL023721 for ; Fri, 9 Mar 2018 10:08:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 07737215CDAE; Fri, 9 Mar 2018 15:08:00 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2B46215CDAA for ; Fri, 9 Mar 2018 15:07:59 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:47 +0100 Message-Id: <20180309150754.11341-2-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] tests: Rename pseries-features-hpt test X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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]); Fri, 09 Mar 2018 15:08:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We're going to use the same test case to exercise all optional pSeries features, so a more generic name is needed. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- .../{pseries-features-hpt.args =3D> pseries-features.args} | 0 .../{pseries-features-hpt.xml =3D> pseries-features.xml} | 0 tests/qemuxml2argvtest.c | 4 = ++-- tests/qemuxml2xmloutdata/pseries-features-hpt.xml | 1 - tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 2 = +- 6 files changed, 4 insertions(+), 4 deletions(-) rename tests/qemuxml2argvdata/{pseries-features-hpt.args =3D> pseries-feat= ures.args} (100%) rename tests/qemuxml2argvdata/{pseries-features-hpt.xml =3D> pseries-featu= res.xml} (100%) delete mode 120000 tests/qemuxml2xmloutdata/pseries-features-hpt.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features.xml diff --git a/tests/qemuxml2argvdata/pseries-features-hpt.args b/tests/qemux= ml2argvdata/pseries-features.args similarity index 100% rename from tests/qemuxml2argvdata/pseries-features-hpt.args rename to tests/qemuxml2argvdata/pseries-features.args diff --git a/tests/qemuxml2argvdata/pseries-features-hpt.xml b/tests/qemuxm= l2argvdata/pseries-features.xml similarity index 100% rename from tests/qemuxml2argvdata/pseries-features-hpt.xml rename to tests/qemuxml2argvdata/pseries-features.xml diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 688846b9b4..ca53912ebe 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1896,10 +1896,10 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); =20 - DO_TEST("pseries-features-hpt", + DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); - DO_TEST_FAILURE("pseries-features-hpt", + DO_TEST_FAILURE("pseries-features", QEMU_CAPS_MACHINE_OPT); DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); =20 diff --git a/tests/qemuxml2xmloutdata/pseries-features-hpt.xml b/tests/qemu= xml2xmloutdata/pseries-features-hpt.xml deleted file mode 120000 index bcaf2e6fec..0000000000 --- a/tests/qemuxml2xmloutdata/pseries-features-hpt.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pseries-features-hpt.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml new file mode 120000 index 0000000000..1b01dbace6 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pseries-features.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 0eb9e6c77a..a363b55446 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -763,7 +763,7 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); =20 - DO_TEST("pseries-features-hpt", + DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608896762842.7893875632922; Fri, 9 Mar 2018 07:21:36 -0800 (PST) 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 B541D7FDD2; Fri, 9 Mar 2018 15:21:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D8377E239; Fri, 9 Mar 2018 15:21:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 38ED14CA99; Fri, 9 Mar 2018 15:21:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29FILuD026028 for ; Fri, 9 Mar 2018 10:18:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 317D410AF9FB; Fri, 9 Mar 2018 15:18:21 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB46510AF9D1 for ; Fri, 9 Mar 2018 15:18:18 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:18:14 +0100 Message-Id: <20180309151814.12033-1-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] tests: Add capabilities data for QEMU 2.12 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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.27]); Fri, 09 Mar 2018 15:21:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- .../caps_2.12.0-gicv2.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv2.aarch64.xml | 318 + .../caps_2.12.0-gicv3.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv3.aarch64.xml | 318 + .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 21091 +++++++++++++++= ++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1093 + .../caps_2.12.0.x86_64.replies | 19113 +++++++++++++++= ++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1270 ++ tests/qemucapabilitiestest.c | 4 + 9 files changed, 77497 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.re= plies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.re= plies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies b= /tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies new file mode 100644 index 0000000000..9b1ed887e9 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies @@ -0,0 +1,17145 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cd)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml new file mode 100644 index 0000000000..c81dfcba43 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -0,0 +1,318 @@ + + 0 + 0 + 0 + [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies b= /tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies new file mode 100644 index 0000000000..9a12b14569 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies @@ -0,0 +1,17145 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cd)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml new file mode 100644 index 0000000000..fae7c26538 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -0,0 +1,318 @@ + + 0 + 0 + 0 + [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/q= emucapabilitiesdata/caps_2.12.0.ppc64.replies new file mode 100644 index 0000000000..0ccf0ad403 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -0,0 +1,21091 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cd)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml new file mode 100644 index 0000000000..e82a7cd5dd --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -0,0 +1,1093 @@ + + 0 + 0 + 0 + [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/= qemucapabilitiesdata/caps_2.12.0.x86_64.replies new file mode 100644 index 0000000000..c161dd006b --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -0,0 +1,19113 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cdec8-dirty)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml new file mode 100644 index 0000000000..50b2ac52d3 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -0,0 +1,1270 @@ + + 0 + 0 + 0 + [...] diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index f9e8e187c2..dcad02588c 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -177,13 +177,17 @@ mymain(void) DO_TEST("x86_64", "caps_2.8.0"); DO_TEST("x86_64", "caps_2.9.0"); DO_TEST("x86_64", "caps_2.10.0"); + DO_TEST("x86_64", "caps_2.12.0"); DO_TEST("aarch64", "caps_2.6.0-gicv2"); DO_TEST("aarch64", "caps_2.6.0-gicv3"); DO_TEST("aarch64", "caps_2.10.0-gicv2"); DO_TEST("aarch64", "caps_2.10.0-gicv3"); + DO_TEST("aarch64", "caps_2.12.0-gicv2"); + DO_TEST("aarch64", "caps_2.12.0-gicv3"); DO_TEST("ppc64", "caps_2.6.0"); DO_TEST("ppc64", "caps_2.9.0"); DO_TEST("ppc64", "caps_2.10.0"); + DO_TEST("ppc64", "caps_2.12.0"); DO_TEST("s390x", "caps_2.7.0"); DO_TEST("s390x", "caps_2.8.0"); DO_TEST("s390x", "caps_2.9.0"); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608098757749.6557758850884; Fri, 9 Mar 2018 07:08:18 -0800 (PST) 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 55DCC811A9; Fri, 9 Mar 2018 15:08:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16DCB7CA77; Fri, 9 Mar 2018 15:08:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CBF084CAA1; Fri, 9 Mar 2018 15:08:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F856A023742 for ; Fri, 9 Mar 2018 10:08:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 28D94215CDAF; Fri, 9 Mar 2018 15:08:05 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C42DC215CDAA for ; Fri, 9 Mar 2018 15:08:04 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:49 +0100 Message-Id: <20180309150754.11341-4-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/8] qemu: Add capability for qom-list-properties X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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.26]); Fri, 09 Mar 2018 15:08:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 4 +++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3eb5ed6d1a..c70bd27f18 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -459,6 +459,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "pl011", "machine.pseries.max-cpu-compat", "dump-completed", + "qom-list-properties", ); =20 =20 @@ -1579,7 +1580,8 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = =3D { { "query-qmp-schema", QEMU_CAPS_QUERY_QMP_SCHEMA }, { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION}, { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS}, - { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES} + { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES }, + { "qom-list-properties", QEMU_CAPS_QOM_LIST_PROPERTIES }, }; =20 struct virQEMUCapsStringFlags virQEMUCapsMigration[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c2ec2be193..ce07dfd6b1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -444,6 +444,7 @@ typedef enum { QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */ QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-= compat=3D */ QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */ + QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties QMP command */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml index c81dfcba43..9c4e40973b 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -187,6 +187,7 @@ + 2011050 0 315524 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml index fae7c26538..06e0068cbd 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -187,6 +187,7 @@ + 2011050 0 315524 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index e82a7cd5dd..a0df689c25 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -185,6 +185,7 @@ + 2011050 0 393199 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index 50b2ac52d3..fbdde1733f 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -228,6 +228,7 @@ + 2011050 0 364740 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608088888919.7139985248604; Fri, 9 Mar 2018 07:08:08 -0800 (PST) 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 8A60367EA8; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B268620B1; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1DFFD181BA02; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F85M5023755 for ; Fri, 9 Mar 2018 10:08:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id BBA3E215CDAE; Fri, 9 Mar 2018 15:08:05 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62B2B215CDAA for ; Fri, 9 Mar 2018 15:08:05 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:50 +0100 Message-Id: <20180309150754.11341-5-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] qemu: Rename virQEMUCapsObjectProps* -> virQEMUCapsDeviceProps* X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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.38]); Fri, 09 Mar 2018 15:08:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In QOM, all devices are objects, which makes the existing names technically correct; however, not all objects are devices, and soon we're going to start looking for object properties in addition to device properties: the former need to go through a different code path, so we need to be able to tell them apart. Using more precise names is a good way to achieve that. While renaming, hunks are also being moved around a bit: the new grouping, too, will make things nicer once we start adding support for object properties. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 239 ++++++++++++++++++++++-----------------= ---- src/qemu/qemu_monitor.c | 4 +- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_monitor_json.h | 2 +- 5 files changed, 128 insertions(+), 121 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c70bd27f18..83ec8a67d5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1559,6 +1559,13 @@ struct virQEMUCapsStringFlags { int flag; }; =20 +struct virQEMUCapsObjectTypeProps { + const char *type; + struct virQEMUCapsStringFlags *props; + size_t nprops; + int capsCondition; +}; + =20 struct virQEMUCapsStringFlags virQEMUCapsCommands[] =3D { { "system_wakeup", QEMU_CAPS_WAKEUP }, @@ -1698,14 +1705,21 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectType= s[] =3D { { "pl011", QEMU_CAPS_DEVICE_PL011 }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { +/* Device properties. + * + * The following can be probed either using the device-list-properties + * QMP command or, for older QEMU versions, from the help text obtained + * through the '-device xxx,?' command line option + */ + +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[]= =3D { { "deflate-on-oom", QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBlk[] =3D= { { "multifunction", QEMU_CAPS_PCI_MULTIFUNCTION }, { "bootindex", QEMU_CAPS_BOOTINDEX }, { "ioeventfd", QEMU_CAPS_VIRTIO_IOEVENTFD }, @@ -1719,7 +1733,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjec= tPropsVirtioBlk[] =3D { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] =3D= { { "tx", QEMU_CAPS_VIRTIO_TX_ALG }, { "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX }, { "rx_queue_size", QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE }, @@ -1730,87 +1744,87 @@ static struct virQEMUCapsStringFlags virQEMUCapsObj= ectPropsVirtioNet[] =3D { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSpaprPCIHostBri= dge[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSpaprPCIHostBri= dge[] =3D { { "numa_node", QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioSCSI[] = =3D { { "iothread", QEMU_CAPS_VIRTIO_SCSI_IOTHREAD }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPCIAssign[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPCIAssign[] =3D= { { "configfd", QEMU_CAPS_PCI_CONFIGFD }, { "bootindex", QEMU_CAPS_PCI_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPCI[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVfioPCI[] =3D { { "bootindex", QEMU_CAPS_VFIO_PCI_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIDisk[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIDisk[] =3D { { "channel", QEMU_CAPS_SCSI_DISK_CHANNEL }, { "wwn", QEMU_CAPS_SCSI_DISK_WWN }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIDEDrive[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIDEDrive[] =3D { { "wwn", QEMU_CAPS_IDE_DRIVE_WWN }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPiix4PM[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPiix4PM[] =3D { { "disable_s3", QEMU_CAPS_PIIX_DISABLE_S3 }, { "disable_s4", QEMU_CAPS_PIIX_DISABLE_S4 }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBRedir[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBRedir[] =3D { { "filter", QEMU_CAPS_USB_REDIR_FILTER }, { "bootindex", QEMU_CAPS_USB_REDIR_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBHost[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBHost[] =3D { { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIGeneric[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIGeneric[] = =3D { { "bootindex", QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsI440FXPCIHost[]= =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsI440FXPCIHost[]= =3D { { "pci-hole64-size", QEMU_CAPS_I440FX_PCI_HOLE64_SIZE }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsQ35PCIHost[] = =3D { { "pci-hole64-size", QEMU_CAPS_Q35_PCI_HOLE64_SIZE }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBStorage[] = =3D { { "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsKVMPit[] =3D { { "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVGA[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVGA[] =3D { { "vgamem_mb", QEMU_CAPS_VGA_VGAMEM }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVmwareSvga[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVmwareSvga[] = =3D { { "vgamem_mb", QEMU_CAPS_VMWARE_SVGA_VGAMEM }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsQxl[] =3D { { "vgamem_mb", QEMU_CAPS_QXL_VGAMEM }, { "vram64_size_mb", QEMU_CAPS_QXL_VRAM64 }, { "max_outputs", QEMU_CAPS_QXL_MAX_OUTPUTS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioGpu[] =3D= { { "virgl", QEMU_CAPS_VIRTIO_GPU_VIRGL }, { "max_outputs", QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, @@ -1818,139 +1832,132 @@ static struct virQEMUCapsStringFlags virQEMUCapsO= bjectPropsVirtioGpu[] =3D { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsICH9[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsICH9[] =3D { { "disable_s3", QEMU_CAPS_ICH9_DISABLE_S3 }, { "disable_s4", QEMU_CAPS_ICH9_DISABLE_S4 }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBNECXHCI[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBNECXHCI[] = =3D { { "p3", QEMU_CAPS_NEC_USB_XHCI_PORTS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIntelIOMMU[] = =3D { { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, { "eim", QEMU_CAPS_INTEL_IOMMU_EIM }, { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB }, }; =20 -/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ -static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { - { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, - { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVE= L}, - { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, - { "blockdev-add/arg-type/+iscsi/password-secret", QEMU_CAPS_ISCSI_PASS= WORD_SECRET }, -}; - -struct virQEMUCapsObjectTypeProps { - const char *type; - struct virQEMUCapsStringFlags *props; - size_t nprops; - int capsCondition; -}; - -static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { - { "virtio-blk-pci", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), +static struct virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] =3D { + { "virtio-blk-pci", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), -1 }, - { "virtio-net-pci", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-pci", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "virtio-scsi-pci", virQEMUCapsObjectPropsVirtioSCSI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), + { "virtio-scsi-pci", virQEMUCapsDevicePropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioSCSI), QEMU_CAPS_VIRTIO_SCSI }, - { "virtio-blk-ccw", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), + { "virtio-blk-ccw", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), QEMU_CAPS_VIRTIO_CCW }, - { "virtio-net-ccw", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-ccw", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "virtio-scsi-ccw", virQEMUCapsObjectPropsVirtioSCSI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), + { "virtio-scsi-ccw", virQEMUCapsDevicePropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioSCSI), QEMU_CAPS_VIRTIO_SCSI }, - { "virtio-blk-s390", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), + { "virtio-blk-s390", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), QEMU_CAPS_VIRTIO_S390 }, - { "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-s390", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "pci-assign", virQEMUCapsObjectPropsPCIAssign, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), + { "pci-assign", virQEMUCapsDevicePropsPCIAssign, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPCIAssign), -1 }, - { "kvm-pci-assign", virQEMUCapsObjectPropsPCIAssign, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), + { "kvm-pci-assign", virQEMUCapsDevicePropsPCIAssign, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPCIAssign), -1 }, - { "vfio-pci", virQEMUCapsObjectPropsVfioPCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPCI), + { "vfio-pci", virQEMUCapsDevicePropsVfioPCI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVfioPCI), QEMU_CAPS_DEVICE_VFIO_PCI }, - { "scsi-disk", virQEMUCapsObjectPropsSCSIDisk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk), + { "scsi-disk", virQEMUCapsDevicePropsSCSIDisk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSCSIDisk), -1 }, - { "ide-drive", virQEMUCapsObjectPropsIDEDrive, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIDEDrive), + { "ide-drive", virQEMUCapsDevicePropsIDEDrive, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsIDEDrive), -1 }, - { "PIIX4_PM", virQEMUCapsObjectPropsPiix4PM, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPiix4PM), + { "PIIX4_PM", virQEMUCapsDevicePropsPiix4PM, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPiix4PM), -1 }, - { "usb-redir", virQEMUCapsObjectPropsUSBRedir, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBRedir), + { "usb-redir", virQEMUCapsDevicePropsUSBRedir, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBRedir), QEMU_CAPS_USB_REDIR }, - { "usb-host", virQEMUCapsObjectPropsUSBHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost), + { "usb-host", virQEMUCapsDevicePropsUSBHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBHost), -1 }, - { "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric), + { "scsi-generic", virQEMUCapsDevicePropsSCSIGeneric, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSCSIGeneric), QEMU_CAPS_DEVICE_SCSI_GENERIC }, - { "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPCIHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPCIHost), + { "i440FX-pcihost", virQEMUCapsDevicePropsI440FXPCIHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsI440FXPCIHost), -1 }, - { "q35-pcihost", virQEMUCapsObjectPropsQ35PCIHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PCIHost), + { "q35-pcihost", virQEMUCapsDevicePropsQ35PCIHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsQ35PCIHost), -1 }, - { "usb-storage", virQEMUCapsObjectPropsUSBStorage, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage), + { "usb-storage", virQEMUCapsDevicePropsUSBStorage, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBStorage), QEMU_CAPS_DEVICE_USB_STORAGE }, - { "kvm-pit", virQEMUCapsObjectPropsKVMPit, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit), + { "kvm-pit", virQEMUCapsDevicePropsKVMPit, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsKVMPit), -1 }, - { "VGA", virQEMUCapsObjectPropsVGA, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA), + { "VGA", virQEMUCapsDevicePropsVGA, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVGA), QEMU_CAPS_DEVICE_VGA }, - { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga), + { "vmware-svga", virQEMUCapsDevicePropsVmwareSvga, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVmwareSvga), QEMU_CAPS_DEVICE_VMWARE_SVGA }, - { "qxl", virQEMUCapsObjectPropsQxl, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl), + { "qxl", virQEMUCapsDevicePropsQxl, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsQxl), QEMU_CAPS_DEVICE_QXL }, - { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), + { "virtio-gpu-pci", virQEMUCapsDevicePropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU }, - { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), + { "virtio-gpu-device", virQEMUCapsDevicePropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU }, - { "ICH9-LPC", virQEMUCapsObjectPropsICH9, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9), + { "ICH9-LPC", virQEMUCapsDevicePropsICH9, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsICH9), -1 }, - { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-pci", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "virtio-balloon-ccw", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-ccw", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "virtio-balloon-device", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-device", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "nec-usb-xhci", virQEMUCapsObjectPropsUSBNECXHCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI), + { "nec-usb-xhci", virQEMUCapsDevicePropsUSBNECXHCI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBNECXHCI), QEMU_CAPS_NEC_USB_XHCI }, - { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU), + { "intel-iommu", virQEMUCapsDevicePropsIntelIOMMU, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsIntelIOMMU), QEMU_CAPS_DEVICE_INTEL_IOMMU }, - { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge), + { "spapr-pci-host-bridge", virQEMUCapsDevicePropsSpaprPCIHostBridge, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSpaprPCIHostBridge), QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, }; =20 +/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ +static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { + { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, + { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVE= L}, + { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, + { "blockdev-add/arg-type/+iscsi/password-secret", QEMU_CAPS_ISCSI_PASS= WORD_SECRET }, +}; + =20 static void virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps, @@ -2081,15 +2088,15 @@ virQEMUCapsParseDeviceStr(virQEMUCapsPtr qemuCaps, = const char *str) nvalues, values); virStringListFreeCount(values, nvalues); =20 - for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type =3D virQEMUCapsObjectProps[i].type; + for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsDeviceProps); i++) { + const char *type =3D virQEMUCapsDeviceProps[i].type; if ((nvalues =3D virQEMUCapsParseDeviceStrObjectProps(str, type, &values)) < 0) return -1; virQEMUCapsProcessStringFlags(qemuCaps, - virQEMUCapsObjectProps[i].nprops, - virQEMUCapsObjectProps[i].props, + virQEMUCapsDeviceProps[i].nprops, + virQEMUCapsDeviceProps[i].props, nvalues, values); virStringListFreeCount(values, nvalues); } @@ -2851,20 +2858,20 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, nvalues, values); virStringListFreeCount(values, nvalues); =20 - for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type =3D virQEMUCapsObjectProps[i].type; - int cap =3D virQEMUCapsObjectProps[i].capsCondition; + for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsDeviceProps); i++) { + const char *type =3D virQEMUCapsDeviceProps[i].type; + int cap =3D virQEMUCapsDeviceProps[i].capsCondition; =20 if (cap >=3D 0 && !virQEMUCapsGet(qemuCaps, cap)) continue; =20 - if ((nvalues =3D qemuMonitorGetObjectProps(mon, + if ((nvalues =3D qemuMonitorGetDeviceProps(mon, type, &values)) < 0) return -1; virQEMUCapsProcessStringFlags(qemuCaps, - virQEMUCapsObjectProps[i].nprops, - virQEMUCapsObjectProps[i].props, + virQEMUCapsDeviceProps[i].nprops, + virQEMUCapsDeviceProps[i].props, nvalues, values); virStringListFreeCount(values, nvalues); } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1d67a97789..8ec759fe3f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3942,7 +3942,7 @@ qemuMonitorGetObjectTypes(qemuMonitorPtr mon, =20 =20 int -qemuMonitorGetObjectProps(qemuMonitorPtr mon, +qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) { @@ -3950,7 +3950,7 @@ qemuMonitorGetObjectProps(qemuMonitorPtr mon, =20 QEMU_CHECK_MONITOR_JSON(mon); =20 - return qemuMonitorJSONGetObjectProps(mon, type, props); + return qemuMonitorJSONGetDeviceProps(mon, type, props); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index adfa87aba9..26074ef7dd 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1094,7 +1094,7 @@ int qemuMonitorGetKVMState(qemuMonitorPtr mon, =20 int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, char ***types); -int qemuMonitorGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props); char *qemuMonitorGetTargetArch(qemuMonitorPtr mon); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 08dfffdf64..eb32811cd1 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6058,7 +6058,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr m= on, #undef MAKE_SET_CMD =20 =20 -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index ec243becc4..4a1da725d1 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -441,7 +441,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, qemuMonitorJSONObjectPropertyPtr prop) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); =20 -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608106637121.59664318947557; Fri, 9 Mar 2018 07:08:26 -0800 (PST) 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 D52E17FDED; Fri, 9 Mar 2018 15:08:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2801880F60; Fri, 9 Mar 2018 15:08:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6A2CD4CAA4; Fri, 9 Mar 2018 15:08:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F8643023760 for ; Fri, 9 Mar 2018 10:08:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5A5EA215CDAE; Fri, 9 Mar 2018 15:08:06 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 019F8215CDAA for ; Fri, 9 Mar 2018 15:08:05 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:51 +0100 Message-Id: <20180309150754.11341-6-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/8] qemu: Extract generic part from qemuMonitorJSONGetDeviceProps() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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.27]); Fri, 09 Mar 2018 15:08:25 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Querying properties for devices and objects is identical except for the specific QMP command that needs to be called. Take the existing qemuMonitorJSONGetDeviceProps(), scrub all the device-specific parts, thus turning it into the generic helper qemuMonitorJSONGetProps(), which is then used to reimplement the original function and will be used again once object properties are needed. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_monitor_json.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index eb32811cd1..141873a705 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6058,9 +6058,11 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr = mon, #undef MAKE_SET_CMD =20 =20 -int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, - const char *type, - char ***props) +static int +qemuMonitorJSONGetProps(qemuMonitorPtr mon, + const char *type, + char ***props, + const char *impl) { int ret =3D -1; virJSONValuePtr cmd; @@ -6072,7 +6074,7 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, =20 *props =3D NULL; =20 - if (!(cmd =3D qemuMonitorJSONMakeCommand("device-list-properties", + if (!(cmd =3D qemuMonitorJSONMakeCommand(impl, "s:typename", type, NULL))) return -1; @@ -6090,8 +6092,9 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, =20 if (!(data =3D virJSONValueObjectGetArray(reply, "return")) || (n =3D virJSONValueArraySize(data)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("device-list-properties reply data was not an arr= ay")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("%s reply data was not an array"), + impl); goto cleanup; } =20 @@ -6104,8 +6107,9 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *tmp; =20 if (!(tmp =3D virJSONValueObjectGetString(child, "name"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("device-list-properties reply data was missin= g 'name'")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("%s reply data was missing 'name'"), + impl); goto cleanup; } =20 @@ -6125,6 +6129,16 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, } =20 =20 +int +qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + return qemuMonitorJSONGetProps(mon, type, props, + "device-list-properties"); +} + + char * qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152060813164327.23563234264975; Fri, 9 Mar 2018 07:08:51 -0800 (PST) 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 9BBCE8A4D8; Fri, 9 Mar 2018 15:08:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 660307DFCC; Fri, 9 Mar 2018 15:08:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 271A8180BAD5; Fri, 9 Mar 2018 15:08:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F87hg023768 for ; Fri, 9 Mar 2018 10:08:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id EDBE1215CDAE; Fri, 9 Mar 2018 15:08:06 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94804215CDAA for ; Fri, 9 Mar 2018 15:08:06 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:52 +0100 Message-Id: <20180309150754.11341-7-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/8] qemu: Add capability for the HTM pSeries feature X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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.30]); Fri, 09 Mar 2018 15:08:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is the first capability that depends on an object property, so we need to introduce a couple new functions at the same time. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 38 +++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_monitor.c | 13 ++ src/qemu/qemu_monitor.h | 3 + src/qemu/qemu_monitor_json.c | 10 ++ src/qemu/qemu_monitor_json.h | 5 + .../caps_2.12.0-gicv2.aarch64.replies | 24 ++- .../caps_2.12.0-gicv2.aarch64.xml | 2 +- .../caps_2.12.0-gicv3.aarch64.replies | 24 ++- .../caps_2.12.0-gicv3.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 170 +++++++++++++++++= +++- tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 3 +- .../caps_2.12.0.x86_64.replies | 30 ++-- tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 2 +- 14 files changed, 289 insertions(+), 38 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 83ec8a67d5..0165de0407 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -460,6 +460,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "machine.pseries.max-cpu-compat", "dump-completed", "qom-list-properties", + "machine.pseries.cap-htm", ); =20 =20 @@ -1950,6 +1951,21 @@ static struct virQEMUCapsObjectTypeProps virQEMUCaps= DeviceProps[] =3D { QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, }; =20 +/* Object properties. + * + * The following can be probed using the qom-list-properties QMP command + */ + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = =3D { + { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, +}; + +static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { + { "spapr-machine", virQEMUCapsObjectPropsSPAPRMachine, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsSPAPRMachine), + -1 }, +}; + /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, @@ -2876,6 +2892,28 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, virStringListFreeCount(values, nvalues); } =20 + /* If the qom-list-properties QMP command is available, then we + * can probe objects in addition to devices */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QOM_LIST_PROPERTIES)) { + for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { + const char *type =3D virQEMUCapsObjectProps[i].type; + int cap =3D virQEMUCapsObjectProps[i].capsCondition; + + if (cap >=3D 0 && !virQEMUCapsGet(qemuCaps, cap)) + continue; + + if ((nvalues =3D qemuMonitorGetObjectProps(mon, + type, + &values)) < 0) + return -1; + virQEMUCapsProcessStringFlags(qemuCaps, + virQEMUCapsObjectProps[i].nprops, + virQEMUCapsObjectProps[i].props, + nvalues, values); + virStringListFreeCount(values, nvalues); + } + } + /* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ce07dfd6b1..62a1138130 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -445,6 +445,7 @@ typedef enum { QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-= compat=3D */ QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */ QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties QMP command */ + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, /* -machine pseries,cap-htm=3D */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8ec759fe3f..6e43d268e1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3954,6 +3954,19 @@ qemuMonitorGetDeviceProps(qemuMonitorPtr mon, } =20 =20 +int +qemuMonitorGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + VIR_DEBUG("type=3D%s props=3D%p", type, props); + + QEMU_CHECK_MONITOR_JSON(mon); + + return qemuMonitorJSONGetObjectProps(mon, type, props); +} + + char * qemuMonitorGetTargetArch(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 26074ef7dd..e83e49cd51 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1097,6 +1097,9 @@ int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, int qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props); +int qemuMonitorGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props); char *qemuMonitorGetTargetArch(qemuMonitorPtr mon); =20 int qemuMonitorNBDServerStart(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 141873a705..bb7e6e12e7 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6139,6 +6139,16 @@ qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, } =20 =20 +int +qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + return qemuMonitorJSONGetProps(mon, type, props, + "qom-list-properties"); +} + + char * qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4a1da725d1..2ce208845a 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -445,6 +445,11 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); +int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) + ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); + char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon); =20 int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies b= /tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies index 9b1ed887e9..1a328d6bce 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies @@ -5208,6 +5208,14 @@ "id": "libvirt-35" } =20 +{ + "id": "libvirt-36", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5497,7 +5505,7 @@ "cpu-max": 1 } ], - "id": "libvirt-36" + "id": "libvirt-37" } =20 { @@ -5668,20 +5676,20 @@ "static": false } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ "emulator" ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { @@ -6838,7 +6846,7 @@ "option": "drive" } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -6896,7 +6904,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -16953,7 +16961,7 @@ "meta-type": "object" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -16969,7 +16977,7 @@ "kernel": true } ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml index 9c4e40973b..dab701b726 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -190,7 +190,7 @@ 2011050 0 - 315524 + 315645 (v2.11.0-2110-gf6d81cd) aarch64 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies b= /tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies index 9a12b14569..6a4302f2e0 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies @@ -5208,6 +5208,14 @@ "id": "libvirt-35" } =20 +{ + "id": "libvirt-36", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5497,7 +5505,7 @@ "cpu-max": 1 } ], - "id": "libvirt-36" + "id": "libvirt-37" } =20 { @@ -5668,20 +5676,20 @@ "static": false } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ "emulator" ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { @@ -6838,7 +6846,7 @@ "option": "drive" } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -6896,7 +6904,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -16953,7 +16961,7 @@ "meta-type": "object" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -16969,7 +16977,7 @@ "kernel": false } ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tes= ts/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml index 06e0068cbd..d14c7948b4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -190,7 +190,7 @@ 2011050 0 - 315524 + 315645 (v2.11.0-2110-gf6d81cd) aarch64 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/q= emucapabilitiesdata/caps_2.12.0.ppc64.replies index 0ccf0ad403..e941e59995 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -5279,6 +5279,162 @@ "id": "libvirt-36" } =20 +{ + "return": [ + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "cap-ibs", + "description": "Indirect Branch Speculation (broken, fixed-ibs, fixe= d-ccd)", + "type": "string" + }, + { + "name": "cap-cfpc", + "description": "Cache Flush on Privilege Change (broken, workaround,= fixed)", + "type": "string" + }, + { + "name": "cap-sbbc", + "description": "Speculation Barrier Bounds Checking (broken, workaro= und, fixed)", + "type": "string" + }, + { + "name": "cap-dfp", + "description": "Allow Decimal Floating Point (DFP)", + "type": "bool" + }, + { + "name": "cap-htm", + "description": "Allow Hardware Transactional Memory (HTM)", + "type": "bool" + }, + { + "name": "cap-vsx", + "description": "Allow Vector Scalar Extensions (VSX)", + "type": "bool" + }, + { + "name": "cap-ibs", + "description": "Indirect Branch Speculation (broken, fixed-ibs, fixe= d-ccd)", + "type": "string" + }, + { + "name": "cap-cfpc", + "description": "Cache Flush on Privilege Change (broken, workaround,= fixed)", + "type": "string" + }, + { + "name": "cap-sbbc", + "description": "Speculation Barrier Bounds Checking (broken, workaro= und, fixed)", + "type": "string" + }, + { + "name": "cap-dfp", + "description": "Allow Decimal Floating Point (DFP)", + "type": "bool" + }, + { + "name": "cap-htm", + "description": "Allow Hardware Transactional Memory (HTM)", + "type": "bool" + }, + { + "name": "cap-vsx", + "description": "Allow Vector Scalar Extensions (VSX)", + "type": "bool" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -5414,7 +5570,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -7610,20 +7766,20 @@ "static": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ "emulator" ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -8775,7 +8931,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -8833,7 +8989,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -18890,7 +19046,7 @@ "meta-type": "object" } ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index a0df689c25..0a2b64e157 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -186,9 +186,10 @@ + 2011050 0 - 393199 + 397043 (v2.11.0-2110-gf6d81cd) ppc64 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/= qemucapabilitiesdata/caps_2.12.0.x86_64.replies index c161dd006b..c06bafa4ba 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4609,6 +4609,14 @@ "id": "libvirt-39" } =20 +{ + "id": "libvirt-40", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -4815,7 +4823,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -5329,7 +5337,7 @@ "migration-safe": true } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -5337,7 +5345,7 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -5345,7 +5353,7 @@ "passthrough", "emulator" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -6636,7 +6644,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -6694,7 +6702,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -16751,7 +16759,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -16939,7 +16947,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } =20 { @@ -17192,7 +17200,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } =20 { @@ -17380,7 +17388,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } =20 { @@ -17633,7 +17641,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index fbdde1733f..dd910853f4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -231,7 +231,7 @@ 2011050 0 - 364740 + 364861 (v2.11.0-2110-gf6d81cdec8-dirty) x86_64 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608130931272.24869945257717; Fri, 9 Mar 2018 07:08:50 -0800 (PST) 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 8991362676; Fri, 9 Mar 2018 15:08:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF3BB7D901; Fri, 9 Mar 2018 15:08:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 866A34CAA9; Fri, 9 Mar 2018 15:08:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F87g6023784 for ; Fri, 9 Mar 2018 10:08:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8C75F215CDAE; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33851215CDAA for ; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:53 +0100 Message-Id: <20180309150754.11341-8-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/8] qemu: Implement the HTM pSeries feature X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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.39]); Fri, 09 Mar 2018 15:08:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is the first in a list of pSeries-specific optional features that have recently been introduced in QEMU. Along with the feature proper, some generic code that will make it easier to implement subsequent features is introduced as well. Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 7 + docs/schemas/domaincommon.rng | 5 + src/conf/domain_conf.c | 19 +++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 149 +++++++++++++++++= ++++ src/qemu/qemu_domain.c | 13 ++ .../pseries-features-invalid-machine.xml | 1 + tests/qemuxml2argvdata/pseries-features.args | 2 +- tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + 11 files changed, 199 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6fd2189cd2..51400afa49 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2057,6 +2057,13 @@ the attribute is not defined, the hypervisor default will be use= d. Since 3.10.0 (QEMU/KVM only) +
htm
+
Configure HTM (Hardware Transational Memory) availability for + pSeries guests. Possible values for the state attri= bute + are on and off. If the attribute is not + defined, the hypervisor default will be used. + Since 4.2.0 (QEMU/KVM only) +
vmcoreinfo
Enable QEMU vmcoreinfo device to let the guest kernel save debug details. Since 3.10.0 (QEMU only) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8165e699d6..b4143f5bc3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4797,6 +4797,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 70b19311b4..98897d3a63 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -152,6 +152,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "ioapic", "hpt", "vmcoreinfo", + "htm", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_= LAST, @@ -19297,6 +19298,22 @@ virDomainDefParseXML(xmlDocPtr xml, } break; =20 + case VIR_DOMAIN_FEATURE_HTM: + if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("missing state attribute '%s' of feature = '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; + } + if ((def->features[val] =3D virTristateSwitchTypeFromString(tm= p)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown state attribute '%s' of feature = '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; + } + VIR_FREE(tmp); + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; @@ -21384,6 +21401,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_HTM: if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " @@ -26845,6 +26863,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_HTM: switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_LAST: case VIR_TRISTATE_SWITCH_ABSENT: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5859c8f4b1..b87a9d9de2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1746,6 +1746,7 @@ typedef enum { VIR_DOMAIN_FEATURE_IOAPIC, VIR_DOMAIN_FEATURE_HPT, VIR_DOMAIN_FEATURE_VMCOREINFO, + VIR_DOMAIN_FEATURE_HTM, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fa0aa5d5c3..d58211c4c6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7117,6 +7117,113 @@ qemuBuildNameCommandLine(virCommandPtr cmd, return 0; } =20 +static int +virDomainFeatureToQEMUCaps(int feature) +{ + switch ((virDomainFeature) feature) { + case VIR_DOMAIN_FEATURE_HTM: + return QEMU_CAPS_MACHINE_PSERIES_CAP_HTM; + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + default: + return -1; + } + + return -1; +} + +static const char* +virDomainFeatureToMachineOption(int feature) +{ + switch ((virDomainFeature) feature) { + case VIR_DOMAIN_FEATURE_HTM: + return "cap-htm"; + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + default: + return NULL; + } + + return NULL; +} + +static int +qemuBuildMachineCommandLineFeature(virBufferPtr buf, + virDomainFeature feature, + const char *value, + virQEMUCapsPtr qemuCaps) +{ + const char *name; + const char *option; + int cap; + int ret =3D -1; + + if (!(name =3D virDomainFeatureTypeToString(feature))) { + virReportEnumRangeError(virDomainFeature, feature); + goto cleanup; + } + + if (!(option =3D virDomainFeatureToMachineOption(feature))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown QEMU option for '%s' feature"), + name); + goto cleanup; + } + + if ((cap =3D virDomainFeatureToQEMUCaps(feature)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown QEMU capability for '%s' feature"), + name); + goto cleanup; + } + + if (cap > 0 && !virQEMUCapsGet(qemuCaps, cap)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'%s' feature not supported by this QEMU binary"), + name); + goto cleanup; + } + + virBufferAsprintf(buf, ",%s=3D%s", option, value); + + ret =3D 0; + + cleanup: + return ret; +} + static int qemuBuildMachineCommandLine(virCommandPtr cmd, virQEMUDriverConfigPtr cfg, @@ -7343,6 +7450,48 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",resize-hpt=3D%s", str); } =20 + for (i =3D 0; i < VIR_DOMAIN_FEATURE_LAST; i++) { + const char *value; + + switch ((virDomainFeature) i) { + case VIR_DOMAIN_FEATURE_HTM: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + break; + + if (!(value =3D virTristateSwitchTypeToString(def->feature= s[i]))) { + virReportEnumRangeError(virTristateSwitch, def->featur= es[i]); + goto cleanup; + } + + if (qemuBuildMachineCommandLineFeature(&buf, i, value, qem= uCaps) < 0) + goto cleanup; + break; + + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + break; + + case VIR_DOMAIN_FEATURE_LAST: + default: + break; + } + } + if (cpu && cpu->model && cpu->mode =3D=3D VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b55013de6a..35d84adae3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3377,6 +3377,19 @@ qemuDomainDefValidateFeatures(const virDomainDef *de= f) } break; =20 + case VIR_DOMAIN_FEATURE_HTM: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && + !qemuDomainIsPSeries(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is not supported for " + "architecture '%s' or machine type '%s'"), + featureName, + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: diff --git a/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml b/= tests/qemuxml2argvdata/pseries-features-invalid-machine.xml index 5a6bb02d5b..76cbf0737f 100644 --- a/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml +++ b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml @@ -9,6 +9,7 @@ + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2a= rgvdata/pseries-features.args index 8cdb329651..0517ca8237 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -7,7 +7,7 @@ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-ppc64 \ -name guest \ -S \ --machine pseries,accel=3Dtcg,resize-hpt=3Drequired \ +-machine pseries,accel=3Dtcg,resize-hpt=3Drequired,cap-htm=3Don \ -m 512 \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index 5dd0dbd0be..a0e98db8b2 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -10,6 +10,7 @@ + destroy diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ca53912ebe..03f8c429e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1898,6 +1898,7 @@ mymain(void) =20 DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); DO_TEST_FAILURE("pseries-features", QEMU_CAPS_MACHINE_OPT); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a363b55446..b9a8bd6f14 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -765,6 +765,7 @@ mymain(void) =20 DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 DO_TEST("pseries-serial-native", --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 21:58:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608099546692.8138945940094; Fri, 9 Mar 2018 07:08:19 -0800 (PST) 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 5A3D17E9E6; Fri, 9 Mar 2018 15:08:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1AA1C7E669; Fri, 9 Mar 2018 15:08:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CBBF44CAA0; Fri, 9 Mar 2018 15:08:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F88J7023791 for ; Fri, 9 Mar 2018 10:08:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2BBAD215CDAE; Fri, 9 Mar 2018 15:08:08 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C74E8215CDAA for ; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:54 +0100 Message-Id: <20180309150754.11341-9-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/8] news: Update for the HTM pSeries feature X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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.26]); Fri, 09 Mar 2018 15:08:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index a51ca973e4..fc56f776ae 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,15 @@
+ + + qemu: Implement the HTM pSeries features + + + Users can now decide whether HTM (Hardware Transactional Memory) + support should be available to the guest. + +
--=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list