From nobody Sun Apr 28 14:31:11 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 1542733729274502.6261199742854; Tue, 20 Nov 2018 09:08:49 -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 D150B8762D; Tue, 20 Nov 2018 17:08:47 +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 91C0C84FF; Tue, 20 Nov 2018 17:08:46 +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 DE9553F602; Tue, 20 Nov 2018 17:08:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKH8gb3020338 for ; Tue, 20 Nov 2018 12:08:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id 977A44C47F; Tue, 20 Nov 2018 17:08:42 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D0625C6C2 for ; Tue, 20 Nov 2018 17:08:41 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 18:08:31 +0100 Message-Id: <20181120170836.31530-2-abologna@redhat.com> In-Reply-To: <20181120170836.31530-1-abologna@redhat.com> References: <20181120170836.31530-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] qemu: Drop duplicated code from qemuDomainDefValidateFeatures() 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: , 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.26]); Tue, 20 Nov 2018 17:08:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Both VIR_DOMAIN_FEATURE_HPT and VIR_DOMAIN_FEATURE_HTM are handled in the exact same way, so we can remove some duplicated code without losing any functionality. Signed-off-by: Andrea Bolognani --- There are plenty more opportunities for refactoring in the code that handles features, but I didn't want to fall into the usual yak-shaving trap so I'm going to work on those now and send the changes as a separate series. src/qemu/qemu_domain.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2f65bbe34e..a8a235a897 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3889,6 +3889,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, break; =20 case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_HTM: if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && !qemuDomainIsPSeries(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -3923,19 +3924,6 @@ 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: --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 14:31:11 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 1542733780839238.31797210443892; Tue, 20 Nov 2018 09:09:40 -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 125A23082E72; Tue, 20 Nov 2018 17:09:38 +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 CFB4B5B6BC; Tue, 20 Nov 2018 17:09:37 +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 83B94181AAB1; Tue, 20 Nov 2018 17:09:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKH8hr1020346 for ; Tue, 20 Nov 2018 12:08:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 700235C6C2; Tue, 20 Nov 2018 17:08:43 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6E335883C for ; Tue, 20 Nov 2018 17:08:42 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 18:08:32 +0100 Message-Id: <20181120170836.31530-3-abologna@redhat.com> In-Reply-To: <20181120170836.31530-1-abologna@redhat.com> References: <20181120170836.31530-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] tests: Add capabilities data for QEMU 3.1.0 on ppc64 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: , 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.46]); Tue, 20 Nov 2018 17:09:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- Snipped heavily; the full patch can be retrieved from https://github.com/andreabolognani/libvirt/tree/nested-hv .../caps_3.1.0.ppc64.replies | 23503 ++++++++++++++++ .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1075 + tests/qemucapabilitiestest.c | 1 + .../qemucaps2xmloutdata/caps_3.1.0.ppc64.xml | 26 + tests/qemucaps2xmltest.c | 1 + 5 files changed, 24606 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_3.1.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml create mode 100644 tests/qemucaps2xmloutdata/caps_3.1.0.ppc64.xml diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.replies b/tests/qe= mucapabilitiesdata/caps_3.1.0.ppc64.replies new file mode 100644 index 0000000000..5f57a3bb18 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.replies @@ -0,0 +1,23503 @@ +{ + "execute": "qmp_capabilities", + "id": "libvirt-1" +} + +{ + "return": { + }, + "id": "libvirt-1" +} + +{ + "execute": "query-version", + "id": "libvirt-2" +} + +{ + "return": { + "qemu": { + "micro": 91, + "minor": 0, + "major": 3 + }, + "package": "v3.1.0-rc1-74-g3c035a41dc" + }, + "id": "libvirt-2" +} [...] diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.1.0.ppc64.xml new file mode 100644 index 0000000000..e3e1b6b281 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -0,0 +1,1075 @@ + [...] + 3000091 + 0 + 437731 + v3.1.0-rc1-74-g3c035a41dc + ppc64 [...] diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 8fe5a55e1d..ff7e9601a2 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -186,6 +186,7 @@ mymain(void) DO_TEST("ppc64", "caps_2.10.0"); DO_TEST("ppc64", "caps_2.12.0"); DO_TEST("ppc64", "caps_3.0.0"); + DO_TEST("ppc64", "caps_3.1.0"); DO_TEST("s390x", "caps_2.7.0"); DO_TEST("s390x", "caps_2.8.0"); DO_TEST("s390x", "caps_2.9.0"); diff --git a/tests/qemucaps2xmloutdata/caps_3.1.0.ppc64.xml b/tests/qemucap= s2xmloutdata/caps_3.1.0.ppc64.xml new file mode 100644 index 0000000000..85623f3980 --- /dev/null +++ b/tests/qemucaps2xmloutdata/caps_3.1.0.ppc64.xml @@ -0,0 +1,26 @@ + + + + + ppc64 + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + + + + + + + + + + + diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 883909a973..3688c4a3b4 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -208,6 +208,7 @@ mymain(void) DO_TEST("ppc64", "caps_2.10.0"); DO_TEST("ppc64", "caps_2.12.0"); DO_TEST("ppc64", "caps_3.0.0"); + DO_TEST("ppc64", "caps_3.1.0"); DO_TEST("s390x", "caps_2.7.0"); DO_TEST("s390x", "caps_2.8.0"); DO_TEST("s390x", "caps_2.9.0"); --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 14:31:11 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 154273378397583.98732985089885; Tue, 20 Nov 2018 09:09:43 -0800 (PST) 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 94401307D84A; Tue, 20 Nov 2018 17:09:42 +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 5F305272B0; Tue, 20 Nov 2018 17:09:42 +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 876BB3F609; Tue, 20 Nov 2018 17:09:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKH8iDU020353 for ; Tue, 20 Nov 2018 12:08:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 465884C47F; Tue, 20 Nov 2018 17:08:44 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0B0A5C6C2 for ; Tue, 20 Nov 2018 17:08:43 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 18:08:33 +0100 Message-Id: <20181120170836.31530-4-abologna@redhat.com> In-Reply-To: <20181120170836.31530-1-abologna@redhat.com> References: <20181120170836.31530-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/6] qemu: Introduce QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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.48]); Tue, 20 Nov 2018 17:09:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 + tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + 5 files changed, 6 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index fde27010e4..20a1a0c201 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -515,6 +515,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 320 */ "memory-backend-memfd.hugetlb", "iothread.poll-max-ns", + "machine.pseries.cap-nested-hv", ); =20 =20 @@ -1372,6 +1373,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjec= tPropsMemoryBackendMemfd[] static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = =3D { { "cap-hpt-max-page-size", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_= SIZE }, { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, + { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV }, }; =20 static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c2caaf6fe1..b1990b6bb8 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -499,6 +499,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 320 */ QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB, /* -object memory-backend-memfd= .hugetlb */ QEMU_CAPS_IOTHREAD_POLLING, /* -object iothread.poll-max-ns */ + QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, /* -machine pseries.cap-neste= d-hv */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.1.0.ppc64.xml index e3e1b6b281..b06b17316a 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -165,6 +165,7 @@ + 3000091 0 437731 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 95429b3ae7..eae2b7edf7 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1981,6 +1981,7 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, + QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); DO_TEST_FAILURE("pseries-features", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4d1a3610ef..2527497675 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -621,6 +621,7 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, + QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 DO_TEST("pseries-serial-native", --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 14:31:11 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 1542733745163475.1652582756092; Tue, 20 Nov 2018 09:09:05 -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 7FF58308214B; Tue, 20 Nov 2018 17:09:02 +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 418CA648D4; Tue, 20 Nov 2018 17:09: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 DCBF33F605; Tue, 20 Nov 2018 17:09:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKH8jjf020358 for ; Tue, 20 Nov 2018 12:08:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2016F4C47F; Tue, 20 Nov 2018 17:08:45 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95E1E5C6C2 for ; Tue, 20 Nov 2018 17:08:44 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 18:08:34 +0100 Message-Id: <20181120170836.31530-5-abologna@redhat.com> In-Reply-To: <20181120170836.31530-1-abologna@redhat.com> References: <20181120170836.31530-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/6] conf: Parse and format nested-hv 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: , 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.42]); Tue, 20 Nov 2018 17:09:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 12 ++++++++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 4 ++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_domain.c | 1 + tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2xmloutdata/pseries-features.xml | 1 + 7 files changed, 25 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2af4960981..84259c45e4 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2295,6 +2295,18 @@ defined, the hypervisor default will be used. Since 4.6.0 (QEMU/KVM only) +
nested-hv
+
Configure nested HV availability for pSeries guests. This needs = to + be enabled from the host (L0) in order to be effective; having HV + support in the (L1) guest is very desiderable if it's planned to + run nested (L2) guests inside it, because it will result in those + nested guests having much better performance than they would when + using KVM PR or TCG. + Possible values for the state attribute are + on and off. If the attribute is not + defined, the hypervisor default will be used. + Since 4.10.0 (QEMU/KVM only) +
=20

Time keeping

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 5ee727eefa..d7a022a4ae 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4976,6 +4976,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 13874837c2..90f5618a04 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -153,6 +153,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "hpt", "vmcoreinfo", "htm", + "nested-hv", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_= LAST, @@ -20155,6 +20156,7 @@ virDomainDefParseXML(xmlDocPtr xml, break; =20 case VIR_DOMAIN_FEATURE_HTM: + case VIR_DOMAIN_FEATURE_NESTED_HV: if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("missing state attribute '%s' of feature = '%s'"), @@ -22317,6 +22319,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_HTM: + case VIR_DOMAIN_FEATURE_NESTED_HV: if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " @@ -28232,6 +28235,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_HTM: + case VIR_DOMAIN_FEATURE_NESTED_HV: 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 467785cd83..b84db2ab7c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1777,6 +1777,7 @@ typedef enum { VIR_DOMAIN_FEATURE_HPT, VIR_DOMAIN_FEATURE_VMCOREINFO, VIR_DOMAIN_FEATURE_HTM, + VIR_DOMAIN_FEATURE_NESTED_HV, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a8a235a897..ee61caa823 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3890,6 +3890,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, =20 case VIR_DOMAIN_FEATURE_HPT: case VIR_DOMAIN_FEATURE_HTM: + case VIR_DOMAIN_FEATURE_NESTED_HV: if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && !qemuDomainIsPSeries(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index 5c842fe87b..6f7d32b065 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -11,6 +11,7 @@ 1 + /usr/bin/qemu-system-ppc64 diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml index 55a44c75a0..7e12bc9c03 100644 --- a/tests/qemuxml2xmloutdata/pseries-features.xml +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -13,6 +13,7 @@ 1048576 + destroy --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 14:31:11 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 1542733748180834.6718041172857; Tue, 20 Nov 2018 09:09: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 B728230832D7; Tue, 20 Nov 2018 17:09:06 +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 7220B6012B; Tue, 20 Nov 2018 17:09:06 +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 1DBB13F606; Tue, 20 Nov 2018 17:09:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKH8jxk020366 for ; Tue, 20 Nov 2018 12:08:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id E88594C47F; Tue, 20 Nov 2018 17:08:45 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E3865883C for ; Tue, 20 Nov 2018 17:08:45 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 18:08:35 +0100 Message-Id: <20181120170836.31530-6-abologna@redhat.com> In-Reply-To: <20181120170836.31530-1-abologna@redhat.com> References: <20181120170836.31530-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/6] qemu: Format nested-hv feature on the command line 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: , 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.44]); Tue, 20 Nov 2018 17:09:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 20 ++++++++++++++++++++ tests/qemuxml2argvdata/pseries-features.args | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 23a6661c10..315419c71b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7468,6 +7468,26 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",cap-htm=3D%s", str); } =20 + if (def->features[VIR_DOMAIN_FEATURE_NESTED_HV] !=3D VIR_TRISTATE_SWIT= CH_ABSENT) { + const char *str; + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED= _HV)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Nested HV configuration is not supported by " + "this QEMU binary")); + goto cleanup; + } + + str =3D virTristateSwitchTypeToString(def->features[VIR_DOMAIN_FEA= TURE_NESTED_HV]); + if (!str) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Invalid setting for nested HV state")); + goto cleanup; + } + + virBufferAsprintf(&buf, ",cap-nested-hv=3D%s", str); + } + if (cpu && cpu->model && cpu->mode =3D=3D VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2a= rgvdata/pseries-features.args index 5d4b5ce930..0acab91c2a 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=3Dnone \ -name guest \ -S \ -machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,resize-hpt=3D= required,\ -cap-hpt-max-page-size=3D1048576k,cap-htm=3Don \ +cap-hpt-max-page-size=3D1048576k,cap-htm=3Don,cap-nested-hv=3Doff \ -m 512 \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 14:31:11 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 1542733787966800.0052279355139; Tue, 20 Nov 2018 09:09:47 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D2653091DA6; Tue, 20 Nov 2018 17:09:46 +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 E3C017E384; Tue, 20 Nov 2018 17:09:45 +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 8AD71181B9E4; Tue, 20 Nov 2018 17:09:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKH8kg8020378 for ; Tue, 20 Nov 2018 12:08:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id BB9985883C; Tue, 20 Nov 2018 17:08:46 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41E2C4C47F for ; Tue, 20 Nov 2018 17:08:46 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 18:08:36 +0100 Message-Id: <20181120170836.31530-7-abologna@redhat.com> In-Reply-To: <20181120170836.31530-1-abologna@redhat.com> References: <20181120170836.31530-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] news: Document nested-hv 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 20 Nov 2018 17:09:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/news.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 4406aeb775..3569c6cd48 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -68,6 +68,16 @@ be viewed via the domain statistics. + + + qemu: Add support for nested HV for pSeries guests + + + Nested HV support makes it possible to run nested (L2) guests + with minimal performance penalty when compared to regular (L1) + guests on ppc64 hardware. + +
--=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list