From nobody Mon Feb 9 17:23:41 2026 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