From nobody Wed May 14 06:27:25 2025 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