From nobody Sat Apr 27 17:50:27 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 1527092307692928.5418871735214; Wed, 23 May 2018 09:18:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 189DC3002096; Wed, 23 May 2018 16:18:26 +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 D4A0C308BDA2; Wed, 23 May 2018 16:18:25 +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 6B7EC4CA86; Wed, 23 May 2018 16:18:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4NGI9Yw015889 for ; Wed, 23 May 2018 12:18:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id B91172026E0E; Wed, 23 May 2018 16:18:09 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECB722026DFD for ; Wed, 23 May 2018 16:18:08 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 May 2018 18:17:57 +0200 Message-Id: <20180523161802.23266-2-abologna@redhat.com> In-Reply-To: <20180523161802.23266-1-abologna@redhat.com> References: <20180523161802.23266-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 1/6] conf: Reintroduce virDomainDef::hpt_resizing 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 23 May 2018 16:18:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We're going to introduce a second HPT-related setting soon, at which point using a single location to store everything is no longer going to cut it. This mostly, but not completely, reverts 3dd1eb3b2650. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 21 ++++++++++++++------- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 7 ++++--- src/qemu/qemu_domain.c | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2253098090..355e497002 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19489,9 +19489,12 @@ virDomainDefParseXML(xmlDocPtr xml, tmp); goto error; } - def->features[val] =3D value; + def->hpt_resizing =3D (virDomainHPTResizing) value; VIR_FREE(tmp); } + + if (def->hpt_resizing !=3D VIR_DOMAIN_HPT_RESIZING_NONE) + def->features[val] =3D VIR_TRISTATE_SWITCH_ON; break; =20 /* coverity[dead_error_begin] */ @@ -21621,13 +21624,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, break; =20 case VIR_DOMAIN_FEATURE_HPT: - if (src->features[i] !=3D dst->features[i]) { + if (src->features[i] !=3D dst->features[i] || + src->hpt_resizing !=3D dst->hpt_resizing) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " - "source: '%s=3D%s', destination: '%s=3D%s= '"), + "source: '%s,%s=3D%s', destination: '%s,%= s=3D%s'"), featureName, - "resizing", virDomainHPTResizingTypeToStrin= g(src->features[i]), - "resizing", virDomainHPTResizingTypeToStrin= g(dst->features[i])); + virTristateSwitchTypeToString(src->features= [i]), + "resizing", virDomainHPTResizingTypeToStrin= g(src->hpt_resizing), + virTristateSwitchTypeToString(dst->features= [i]), + "resizing", virDomainHPTResizingTypeToStrin= g(dst->hpt_resizing)); return false; } break; @@ -27202,11 +27208,12 @@ virDomainDefFormatInternal(virDomainDefPtr def, break; =20 case VIR_DOMAIN_FEATURE_HPT: - if (def->features[i] =3D=3D VIR_DOMAIN_HPT_RESIZING_NONE) + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ON || + def->hpt_resizing =3D=3D VIR_DOMAIN_HPT_RESIZING_NONE) break; =20 virBufferAsprintf(buf, "\n", - virDomainHPTResizingTypeToString(def->fe= atures[i])); + virDomainHPTResizingTypeToString(def->hp= t_resizing)); break; =20 /* coverity[dead_error_begin] */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 37356df42d..cb0945b6c0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2376,6 +2376,7 @@ struct _virDomainDef { int kvm_features[VIR_DOMAIN_KVM_LAST]; unsigned int hyperv_spinlocks; virGICVersion gic_version; + virDomainHPTResizing hpt_resizing; char *hyperv_vendor_id; int apic_eoi; =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cb397c7558..ddbde54a8c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7172,17 +7172,18 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } } =20 - if (def->features[VIR_DOMAIN_FEATURE_HPT] !=3D VIR_DOMAIN_HPT_RESIZING= _NONE) { + if (def->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWITCH_O= N) { const char *str; =20 - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT= )) { + if (def->hpt_resizing !=3D VIR_DOMAIN_HPT_RESIZING_NONE && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT= )) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("HTP resizing is not supported by this " "QEMU binary")); goto cleanup; } =20 - str =3D virDomainHPTResizingTypeToString(def->features[VIR_DOMAIN_= FEATURE_HPT]); + str =3D virDomainHPTResizingTypeToString(def->hpt_resizing); if (!str) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid setting for HPT resizing")); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ee676a2789..4bf57b74b6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3623,7 +3623,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) break; =20 case VIR_DOMAIN_FEATURE_HPT: - if (def->features[i] !=3D VIR_DOMAIN_HPT_RESIZING_NONE && + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && !qemuDomainIsPSeries(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("The '%s' feature is not supported for " --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:50:27 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 15270923064631000.1962643409288; Wed, 23 May 2018 09:18:26 -0700 (PDT) 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 C578A11B265; Wed, 23 May 2018 16:18:24 +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 8AE482A17A; Wed, 23 May 2018 16:18:24 +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 09C6C18033F1; Wed, 23 May 2018 16:18:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4NGIAPb015896 for ; Wed, 23 May 2018 12:18:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF5022026E0E; Wed, 23 May 2018 16:18:10 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 179792026DFD for ; Wed, 23 May 2018 16:18:09 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 May 2018 18:17:58 +0200 Message-Id: <20180523161802.23266-3-abologna@redhat.com> In-Reply-To: <20180523161802.23266-1-abologna@redhat.com> References: <20180523161802.23266-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 2/6] conf: Tweak HPT parsing and formatting 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.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.39]); Wed, 23 May 2018 16:18:25 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This doesn't seem very useful at the moment, but it will make sense once we introduce another HPT-related setting. The output XML is decoupled from the input XML in preparation of future changes as well; while doing so, we can shave a few lines off the latter. This commit is best viewed with 'git show -w'. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 25 ++++++++++++--- src/qemu/qemu_command.c | 32 ++++++++++--------- tests/qemuxml2argvdata/pseries-features.xml | 14 ++------ tests/qemuxml2xmloutdata/pseries-features.xml | 29 ++++++++++++++++- 4 files changed, 68 insertions(+), 32 deletions(-) mode change 120000 =3D> 100644 tests/qemuxml2xmloutdata/pseries-features.x= ml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 355e497002..20b845f02a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27207,14 +27207,31 @@ virDomainDefFormatInternal(virDomainDefPtr def, virDomainIOAPICTypeToString(def->feature= s[i])); break; =20 - case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_HPT: { + bool hasResizing =3D def->hpt_resizing !=3D VIR_DOMAIN_HPT= _RESIZING_NONE; + char *resizing =3D NULL; + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ON || - def->hpt_resizing =3D=3D VIR_DOMAIN_HPT_RESIZING_NONE) + !hasResizing) { break; + } + + if (hasResizing) { + if (virAsprintf(&resizing, " resizing=3D'%s'", + virDomainHPTResizingTypeToString(def->= hpt_resizing)) < 0) { + goto error; + } + } else { + if (VIR_STRDUP(resizing, "") < 0) + goto error; + } =20 - virBufferAsprintf(buf, "\n", - virDomainHPTResizingTypeToString(def->hp= t_resizing)); + virBufferAsprintf(buf, "\n", + resizing); + + VIR_FREE(resizing); break; + } =20 /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ddbde54a8c..b446a08613 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7173,24 +7173,26 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } =20 if (def->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWITCH_O= N) { - const char *str; =20 - if (def->hpt_resizing !=3D VIR_DOMAIN_HPT_RESIZING_NONE && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT= )) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("HTP resizing is not supported by this " - "QEMU binary")); - goto cleanup; - } + if (def->hpt_resizing !=3D VIR_DOMAIN_HPT_RESIZING_NONE) { + const char *str; =20 - str =3D virDomainHPTResizingTypeToString(def->hpt_resizing); - if (!str) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Invalid setting for HPT resizing")); - goto cleanup; - } + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE= _HPT)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("HTP resizing is not supported by this " + "QEMU binary")); + goto cleanup; + } + + str =3D virDomainHPTResizingTypeToString(def->hpt_resizing); + if (!str) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Invalid setting for HPT resizing")); + goto cleanup; + } =20 - virBufferAsprintf(&buf, ",resize-hpt=3D%s", str); + virBufferAsprintf(&buf, ",resize-hpt=3D%s", str); + } } =20 if (cpu && cpu->model && diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index 5dd0dbd0be..5ef1a744c8 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -2,27 +2,17 @@ guest 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 524288 - 524288 1 hvm - - - destroy - restart - destroy /usr/bin/qemu-system-ppc64 - - - - - + + - diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml deleted file mode 120000 index 1b01dbace6..0000000000 --- a/tests/qemuxml2xmloutdata/pseries-features.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pseries-features.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 100644 index 0000000000..e8ed842fb6 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -0,0 +1,28 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + + + + + + --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:50:27 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 152709231387858.51924325961727; Wed, 23 May 2018 09:18:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E61B08CB1; Wed, 23 May 2018 16:18:31 +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 A41733001B80; Wed, 23 May 2018 16:18:31 +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 35BB24CA82; Wed, 23 May 2018 16:18:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4NGICV6015905 for ; Wed, 23 May 2018 12:18:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B5C52026E0E; Wed, 23 May 2018 16:18:12 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C8B92026DFD for ; Wed, 23 May 2018 16:18:10 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 May 2018 18:17:59 +0200 Message-Id: <20180523161802.23266-4-abologna@redhat.com> In-Reply-To: <20180523161802.23266-1-abologna@redhat.com> References: <20180523161802.23266-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 3/6] qemu: Introduce QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MPS 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 23 May 2018 16:18:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + .../caps_2.12.0.aarch64.replies | 24 ++- .../caps_2.12.0.aarch64.xml | 2 +- .../caps_2.12.0.ppc64.replies | 175 +++++++++++++++++- .../caps_2.12.0.ppc64.xml | 2 +- .../caps_2.12.0.s390x.replies | 26 ++- .../caps_2.12.0.s390x.xml | 2 +- .../caps_2.12.0.x86_64.replies | 30 +-- .../caps_2.12.0.x86_64.xml | 2 +- 10 files changed, 233 insertions(+), 39 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8a63db5f4f..ab034b7693 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -489,6 +489,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "screendump_device", "hda-output", "blockdev-del", + "machine.pseries.cap-hpt-mps", ); =20 =20 @@ -1401,10 +1402,17 @@ static struct virQEMUCapsStringFlags virQEMUCapsObj= ectPropsMemoryBackendFile[] =3D { "discard-data", QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD }, }; =20 +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = =3D { + { "cap-hpt-mps", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MPS }, +}; + static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { { "memory-backend-file", virQEMUCapsObjectPropsMemoryBackendFile, ARRAY_CARDINALITY(virQEMUCapsObjectPropsMemoryBackendFile), QEMU_CAPS_OBJECT_MEMORY_FILE }, + { "spapr-machine", virQEMUCapsObjectPropsSPAPRMachine, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsSPAPRMachine), + -1 }, }; =20 static void diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 3e120e64c0..fecf966f05 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -473,6 +473,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_SCREENDUMP_DEVICE, /* screendump command accepts device & he= ad */ QEMU_CAPS_HDA_OUTPUT, /* -device hda-output */ QEMU_CAPS_BLOCKDEV_DEL, /* blockdev-del is supported */ + QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MPS, /* -machine pseries,cap-hpt-mps= =3D */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies b/tests= /qemucapabilitiesdata/caps_2.12.0.aarch64.replies index 3ca0ea13fa..5bcbc3e9b7 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies @@ -5329,6 +5329,14 @@ "id": "libvirt-36" } =20 +{ + "id": "libvirt-37", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5623,7 +5631,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -5799,20 +5807,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 { @@ -6973,7 +6981,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -7035,7 +7043,7 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -18403,7 +18411,7 @@ "meta-type": "object" } ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -18419,7 +18427,7 @@ "kernel": false } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml b/tests/qem= ucapabilitiesdata/caps_2.12.0.aarch64.xml index 0dbd354887..6efd4b4147 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml @@ -168,7 +168,7 @@ 2011090 0 - 343099 + 343234 v2.12.0-rc0 aarch64 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/q= emucapabilitiesdata/caps_2.12.0.ppc64.replies index 1e93cd6dca..e71d69519d 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -5376,6 +5376,167 @@ "id": "libvirt-37" } =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": "memory-encryption", + "description": "Set memory encyption object to use", + "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-38" +} + { "return": [ { @@ -5511,7 +5672,7 @@ "cpu-max": 1 } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { @@ -7707,20 +7868,20 @@ "static": false } ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { "return": [ "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -8876,7 +9037,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -8938,7 +9099,7 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -20306,7 +20467,7 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index 9b08993b7e..eb89c6cd2d 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -165,7 +165,7 @@ 2011090 0 - 419968 + 423940 v2.12.0-rc0 ppc64 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies b/tests/q= emucapabilitiesdata/caps_2.12.0.s390x.replies index 29c3403550..6591843515 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies @@ -3682,6 +3682,14 @@ "id": "libvirt-36" } =20 +{ + "id": "libvirt-37", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -3737,7 +3745,7 @@ "alias": "s390-ccw-virtio" } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -4272,20 +4280,20 @@ "migration-safe": true } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ "emulator" ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -5410,7 +5418,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -5472,7 +5480,7 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -16840,7 +16848,7 @@ "meta-type": "object" } ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -16878,11 +16886,11 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } =20 { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "Property '.migratable' not found" diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.s390x.xml index df0f6e4eba..47aed54958 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml @@ -132,7 +132,7 @@ 2012000 0 - 371055 + 371190 s390x diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/= qemucapabilitiesdata/caps_2.12.0.x86_64.replies index c40046beef..34cd884f2c 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4659,6 +4659,14 @@ "id": "libvirt-40" } =20 +{ + "id": "libvirt-41", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -4855,7 +4863,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -5369,7 +5377,7 @@ "migration-safe": true } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -5377,7 +5385,7 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -5385,7 +5393,7 @@ "passthrough", "emulator" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -6672,7 +6680,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -6734,7 +6742,7 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -18102,7 +18110,7 @@ "meta-type": "object" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { @@ -18292,7 +18300,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } =20 { @@ -18547,7 +18555,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } =20 { @@ -18737,7 +18745,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } =20 { @@ -18992,7 +19000,7 @@ } } }, - "id": "libvirt-51" + "id": "libvirt-52" } =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 3c7dadffcd..7ebc894a0c 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -206,7 +206,7 @@ 2011090 0 - 390813 + 390948 v2.12.0-rc0 x86_64 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:50:27 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 1527092315152959.4252994407395; Wed, 23 May 2018 09:18:35 -0700 (PDT) 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 886D730D2588; Wed, 23 May 2018 16:18:33 +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 E55EF5D6B4; Wed, 23 May 2018 16:18:32 +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 83ABF4CA81; Wed, 23 May 2018 16:18:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4NGIDMf015913 for ; Wed, 23 May 2018 12:18:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id EC0712026E0E; Wed, 23 May 2018 16:18:12 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E4E12026DFD for ; Wed, 23 May 2018 16:18:12 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 May 2018 18:18:00 +0200 Message-Id: <20180523161802.23266-5-abologna@redhat.com> In-Reply-To: <20180523161802.23266-1-abologna@redhat.com> References: <20180523161802.23266-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 4/6] tests: Pretend we have pseries.cap-hpt-mps in 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 23 May 2018 16:18:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" That's not the case, of course, but the relevant QEMU code has not been merged upstream yet and this is a cheap way to show the capability is actually detected correctly. Do not merge. Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 5 +++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/q= emucapabilitiesdata/caps_2.12.0.ppc64.replies index e71d69519d..55f70fb0a0 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -5532,6 +5532,11 @@ "name": "cap-vsx", "description": "Allow Vector Scalar Extensions (VSX)", "type": "bool" + }, + { + "name": "cap-hpt-mps", + "description": "Maximum page shift for Hash Page Table guests (12, 1= 6, 24, 34)", + "type": "int" } ], "id": "libvirt-38" diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index eb89c6cd2d..155ed2c246 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -163,9 +163,10 @@ + 2011090 0 - 423940 + 424089 v2.12.0-rc0 ppc64 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:50:27 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 1527092320745199.32350147056673; Wed, 23 May 2018 09:18:40 -0700 (PDT) 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 4F3DA3002074; Wed, 23 May 2018 16:18:39 +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 D69A55D6B4; Wed, 23 May 2018 16:18:38 +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 7E92C4CA88; Wed, 23 May 2018 16:18:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4NGIEiQ015926 for ; Wed, 23 May 2018 12:18:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id F26A32026E0E; Wed, 23 May 2018 16:18:13 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AEAD2026DFD for ; Wed, 23 May 2018 16:18:13 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 May 2018 18:18:01 +0200 Message-Id: <20180523161802.23266-6-abologna@redhat.com> In-Reply-To: <20180523161802.23266-1-abologna@redhat.com> References: <20180523161802.23266-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 5/6] conf: Parse and format HPT maxpagesize 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.42]); Wed, 23 May 2018 16:18:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This commit is best viewed with 'git show -w'. Signed-off-by: Andrea Bolognani --- docs/schemas/domaincommon.rng | 21 ++++++--- src/conf/domain_conf.c | 44 ++++++++++++++++--- src/conf/domain_conf.h | 1 + tests/qemuxml2argvdata/pseries-features.xml | 4 +- tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmloutdata/pseries-features.xml | 4 +- tests/qemuxml2xmltest.c | 1 + 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index f16e157397..7b631f7d93 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5018,13 +5018,20 @@ =20 - - - enabled - disabled - required - - + + + + enabled + disabled + required + + + + + + + + =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 20b845f02a..e84cfb0d05 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19493,8 +19493,24 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(tmp); } =20 - if (def->hpt_resizing !=3D VIR_DOMAIN_HPT_RESIZING_NONE) + if (virDomainParseScaledValue("./features/hpt/maxpagesize", + NULL, + ctxt, + &def->hpt_maxpagesize, + 1024, + ULLONG_MAX, + false) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", + _("Unable to parse HPT maxpagesize setting"= )); + goto error; + } + def->hpt_maxpagesize =3D VIR_ROUND_UP(def->hpt_maxpagesize, 10= 24); + + if (def->hpt_resizing !=3D VIR_DOMAIN_HPT_RESIZING_NONE || + def->hpt_maxpagesize > 0) { def->features[val] =3D VIR_TRISTATE_SWITCH_ON; + } break; =20 /* coverity[dead_error_begin] */ @@ -21625,15 +21641,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, =20 case VIR_DOMAIN_FEATURE_HPT: if (src->features[i] !=3D dst->features[i] || - src->hpt_resizing !=3D dst->hpt_resizing) { + src->hpt_resizing !=3D dst->hpt_resizing || + src->hpt_maxpagesize !=3D dst->hpt_maxpagesize) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " - "source: '%s,%s=3D%s', destination: '%s,%= s=3D%s'"), + "source: '%s,%s=3D%s,%s=3D%llu', destinat= ion: '%s,%s=3D%s,%s=3D%llu'"), featureName, virTristateSwitchTypeToString(src->features= [i]), "resizing", virDomainHPTResizingTypeToStrin= g(src->hpt_resizing), + "maxpagesize", src->hpt_maxpagesize, virTristateSwitchTypeToString(dst->features= [i]), - "resizing", virDomainHPTResizingTypeToStrin= g(dst->hpt_resizing)); + "resizing", virDomainHPTResizingTypeToStrin= g(dst->hpt_resizing), + "maxpagesize", dst->hpt_maxpagesize); return false; } break; @@ -27209,10 +27228,11 @@ virDomainDefFormatInternal(virDomainDefPtr def, =20 case VIR_DOMAIN_FEATURE_HPT: { bool hasResizing =3D def->hpt_resizing !=3D VIR_DOMAIN_HPT= _RESIZING_NONE; + bool hasMaxPageSize =3D def->hpt_maxpagesize > 0; char *resizing =3D NULL; =20 if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ON || - !hasResizing) { + (!hasResizing && !hasMaxPageSize)) { break; } =20 @@ -27226,8 +27246,18 @@ virDomainDefFormatInternal(virDomainDefPtr def, goto error; } =20 - virBufferAsprintf(buf, "\n", - resizing); + if (hasMaxPageSize) { + virBufferAsprintf(buf, "\n", + resizing); + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, "%llu= \n", + def->hpt_maxpagesize / 1024); + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } else { + virBufferAsprintf(buf, "\n", + resizing); + } =20 VIR_FREE(resizing); break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb0945b6c0..dbc649347c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2377,6 +2377,7 @@ struct _virDomainDef { unsigned int hyperv_spinlocks; virGICVersion gic_version; virDomainHPTResizing hpt_resizing; + unsigned long long hpt_maxpagesize; char *hyperv_vendor_id; int apic_eoi; =20 diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index 5ef1a744c8..30cee5b81c 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -7,7 +7,9 @@ hvm - + + 1 + /usr/bin/qemu-system-ppc64 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1d023129ac..a7392ea655 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1822,6 +1822,7 @@ mymain(void) =20 DO_TEST("pseries-features", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MPS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); DO_TEST_FAILURE("pseries-features", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml index e8ed842fb6..f36705f011 100644 --- a/tests/qemuxml2xmloutdata/pseries-features.xml +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -9,7 +9,9 @@ - + + 1048576 + destroy diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e31d8212fe..128c14d5d1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -617,6 +617,7 @@ mymain(void) =20 DO_TEST("pseries-features", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MPS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 DO_TEST("pseries-serial-native", --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:50:27 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 1527092558572586.9354099672738; Wed, 23 May 2018 09:22:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D7E1E9E28; Wed, 23 May 2018 16:22:37 +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 F3CE22010CB0; Wed, 23 May 2018 16:22:36 +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 AC7314CA81; Wed, 23 May 2018 16:22:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4NGIEWI015929 for ; Wed, 23 May 2018 12:18:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id D60152026E0E; Wed, 23 May 2018 16:18:14 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FA252026DFD for ; Wed, 23 May 2018 16:18:14 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 May 2018 18:18:02 +0200 Message-Id: <20180523161802.23266-7-abologna@redhat.com> In-Reply-To: <20180523161802.23266-1-abologna@redhat.com> References: <20180523161802.23266-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 6/6] qemu: Format pseries.cap-hpt-mps 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: , 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 23 May 2018 16:22:37 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This makes the feature fully functional. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1571078 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 26 ++++++++++++++++++++ tests/qemuxml2argvdata/pseries-features.args | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b446a08613..983839e81c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7193,6 +7193,32 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, =20 virBufferAsprintf(&buf, ",resize-hpt=3D%s", str); } + + if (def->hpt_maxpagesize > 0) { + unsigned long long tmp =3D def->hpt_maxpagesize; + unsigned int shifts =3D 0; + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_HP= T_MPS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Limiting the page size for HPT guest is " + "not supported by this QEMU binary")); + goto cleanup; + } + + /* QEMU expects the argument to be a number of left shifts: + * for example, if you wanted to limit the guest to 4 KiB page= s, + * since 4096 =3D=3D 1 << 12, you would need to add cap-hpt-mp= s=3D12 + * to the command line. + * + * Convert from our internal representation, which is bytes, + * to the one QEMU expects */ + while (tmp > 1) { + tmp =3D tmp >> 1; + shifts++; + } + + virBufferAsprintf(&buf, ",cap-hpt-mps=3D%u", shifts); + } } =20 if (cpu && cpu->model && diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2a= rgvdata/pseries-features.args index f5c1959cca..4e581a69a1 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -7,7 +7,8 @@ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-ppc64 \ -name guest \ -S \ --machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,resize-hpt=3D= required \ +-machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,resize-hpt=3D= required,\ +cap-hpt-mps=3D30 \ -m 512 \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list