From nobody Sun May 5 02:20:56 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 1517935404954732.0819267504362; Tue, 6 Feb 2018 08:43:24 -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 D14A6272C2; Tue, 6 Feb 2018 16:43:23 +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 996526445E; Tue, 6 Feb 2018 16:43:23 +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 6070118033E0; Tue, 6 Feb 2018 16:43:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhGAA008416 for ; Tue, 6 Feb 2018 11:43:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id A43CC6046C; Tue, 6 Feb 2018 16:43:16 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29CA264452 for ; Tue, 6 Feb 2018 16:43:15 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:50 +0100 Message-Id: <20180206164300.13450-2-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/11] qemu: Move feature verification from PostParse() to Validate() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 06 Feb 2018 16:43:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We want to perform all feature verification in a single spot, but some of it (eg. GIC) is currently being performed at command line generation time, and moving it to PostParse() would cause guests to disappear. Moving verification to Validate() allows us to side-step the issue. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 54 +++++++++++++++++++++++++---------------------= ---- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index df433c2f0..27a4751e9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3113,30 +3113,6 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) } =20 =20 -static int -qemuDomainDefVerifyFeatures(const virDomainDef *def) -{ - if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D=3D VIR_TRISTATE_SWITC= H_ON && - !ARCH_IS_X86(def->os.arch)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("I/O APIC tuning is not supported " - "for '%s' architecture"), - virArchToString(def->os.arch)); - return -1; - } - - if (def->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWITCH_O= N && - !qemuDomainIsPSeries(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", - _("HPT tuning is only supported for pSeries guests"= )); - return -1; - } - - return 0; -} - - static int qemuDomainDefPostParseBasic(virDomainDefPtr def, virCapsPtr caps, @@ -3195,9 +3171,6 @@ qemuDomainDefPostParse(virDomainDefPtr def, =20 qemuDomainDefEnableDefaultFeatures(def, qemuCaps); =20 - if (qemuDomainDefVerifyFeatures(def) < 0) - goto cleanup; - if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0) goto cleanup; =20 @@ -3250,6 +3223,30 @@ qemuDomainDefGetVcpuHotplugGranularity(const virDoma= inDef *def) #define QEMU_MAX_VCPUS_WITHOUT_EIM 255 =20 =20 +static int +qemuDomainDefValidateFeatures(const virDomainDef *def) +{ + if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D=3D VIR_TRISTATE_SWITC= H_ON && + !ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("I/O APIC tuning is not supported " + "for '%s' architecture"), + virArchToString(def->os.arch)); + return -1; + } + + if (def->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWITCH_O= N && + !qemuDomainIsPSeries(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", + _("HPT tuning is only supported for pSeries guests"= )); + return -1; + } + + return 0; +} + + static int qemuDomainDefValidate(const virDomainDef *def, virCapsPtr caps ATTRIBUTE_UNUSED, @@ -3362,6 +3359,9 @@ qemuDomainDefValidate(const virDomainDef *def, } } =20 + if (qemuDomainDefValidateFeatures(def) < 0) + goto cleanup; + ret =3D 0; =20 cleanup: --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935408327255.99734863497395; Tue, 6 Feb 2018 08:43:28 -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 1C21B2C8B; Tue, 6 Feb 2018 16:43:27 +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 E9A7F5EE13; Tue, 6 Feb 2018 16:43:26 +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 ACFBE18033E5; Tue, 6 Feb 2018 16:43:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhIjj008433 for ; Tue, 6 Feb 2018 11:43:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9C46312A4F; Tue, 6 Feb 2018 16:43:18 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 229B36046C for ; Tue, 6 Feb 2018 16:43:16 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:51 +0100 Message-Id: <20180206164300.13450-3-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/11] qemu: Use switch in 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: , 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.27]); Tue, 06 Feb 2018 16:43:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The compiler can make sure we are handling all features. While reworking the logic, also change error messages to a more consistent style. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/libvirt_private.syms | 2 ++ src/qemu/qemu_domain.c | 57 ++++++++++++++++++++++++++++++++++++--------= ---- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0bce0bbfb..17c3b71e0 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -345,6 +345,8 @@ virDomainDiskSetDriver; virDomainDiskSetFormat; virDomainDiskSetSource; virDomainDiskSetType; +virDomainFeatureTypeFromString; +virDomainFeatureTypeToString; virDomainFSDefFree; virDomainFSDefNew; virDomainFSIndexByName; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 27a4751e9..dd36b42eb 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3226,21 +3226,50 @@ qemuDomainDefGetVcpuHotplugGranularity(const virDom= ainDef *def) static int qemuDomainDefValidateFeatures(const virDomainDef *def) { - if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D=3D VIR_TRISTATE_SWITC= H_ON && - !ARCH_IS_X86(def->os.arch)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("I/O APIC tuning is not supported " - "for '%s' architecture"), - virArchToString(def->os.arch)); - return -1; - } + size_t i; =20 - if (def->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWITCH_O= N && - !qemuDomainIsPSeries(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", - _("HPT tuning is only supported for pSeries guests"= )); - return -1; + for (i =3D 0; i < VIR_DOMAIN_FEATURE_LAST; i++) { + const char *featureName =3D virDomainFeatureTypeToString(i); + + switch ((virDomainFeature) i) { + case VIR_DOMAIN_FEATURE_IOAPIC: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && + !ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is only supported for %= s guests"), + featureName, "x86"); + return -1; + } + break; + + case VIR_DOMAIN_FEATURE_HPT: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && + !qemuDomainIsPSeries(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is only supported for %= s guests"), + featureName, "pSeries"); + return -1; + } + break; + + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + break; + } } =20 return 0; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935402937775.0267982703589; Tue, 6 Feb 2018 08:43:22 -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 B09DB28222; Tue, 6 Feb 2018 16:43:21 +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 80B769CAF; Tue, 6 Feb 2018 16:43:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 363A24A46C; Tue, 6 Feb 2018 16:43:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhK2i008450 for ; Tue, 6 Feb 2018 11:43:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5DA3F6046C; Tue, 6 Feb 2018 16:43:20 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8F6A12A58 for ; Tue, 6 Feb 2018 16:43:18 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:52 +0100 Message-Id: <20180206164300.13450-4-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/11] qemu: Move GIC checks to 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Feb 2018 16:43:22 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Keep them along with other arch/machine type checks for features instead of waiting until command line generation time. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 7 ------- src/qemu/qemu_domain.c | 11 ++++++++++- tests/qemuxml2argvtest.c | 12 ++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 24b434a45..529079be0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7192,13 +7192,6 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, =20 if (def->features[VIR_DOMAIN_FEATURE_GIC] =3D=3D VIR_TRISTATE_SWIT= CH_ON) { if (def->gic_version !=3D VIR_GIC_VERSION_NONE) { - if (!qemuDomainIsVirt(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("gic-version option is available " - "only for ARM virt machine")); - goto cleanup; - } - /* The default GIC version (GICv2) should not be specified= on * the QEMU commandline for backwards compatibility reason= s */ if (def->gic_version !=3D VIR_GIC_VERSION_2) { diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index dd36b42eb..98cba8789 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3252,6 +3252,16 @@ qemuDomainDefValidateFeatures(const virDomainDef *de= f) } break; =20 + case VIR_DOMAIN_FEATURE_GIC: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && + !qemuDomainIsVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is only supported for %= s guests"), + featureName, "mach-virt"); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -3264,7 +3274,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_VMPORT: - case VIR_DOMAIN_FEATURE_GIC: case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_LAST: diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c8739909d..b7afb6980 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2656,12 +2656,12 @@ mymain(void) DO_TEST_PARSE_ERROR("aarch64-gic-invalid", QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_FAILURE("aarch64-gic-not-virt", - QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_FAILURE("aarch64-gic-not-arm", - QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_PARSE_ERROR("aarch64-gic-not-virt", + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_PARSE_ERROR("aarch64-gic-not-arm", + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); DO_TEST("aarch64-kvm-32-on-64", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_DEVICE_PL011, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935411599275.403118287589; Tue, 6 Feb 2018 08:43:31 -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 71C893E513; Tue, 6 Feb 2018 16:43:30 +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 4B52560273; Tue, 6 Feb 2018 16:43:30 +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 0233D18033EB; Tue, 6 Feb 2018 16:43:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhMnS008462 for ; Tue, 6 Feb 2018 11:43:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0C8B74262; Tue, 6 Feb 2018 16:43:22 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 885A912A4D for ; Tue, 6 Feb 2018 16:43:20 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:53 +0100 Message-Id: <20180206164300.13450-5-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/11] conf: Use switch in virDomainDefFeaturesCheckABIStability() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 06 Feb 2018 16:43:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The compiler can make sure we are handling all features. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 34aae82f1..e4d01b869 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21324,14 +21324,39 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, size_t i; =20 for (i =3D 0; i < VIR_DOMAIN_FEATURE_LAST; i++) { - if (src->features[i] !=3D dst->features[i]) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("State of feature '%s' differs: " - "source: '%s', destination: '%s'"), - virDomainFeatureTypeToString(i), - virTristateSwitchTypeToString(src->features[i]), - virTristateSwitchTypeToString(dst->features[i])= ); - return false; + const char *featureName =3D virDomainFeatureTypeToString(i); + + switch ((virDomainFeature) i) { + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + if (src->features[i] !=3D dst->features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s' differs: " + "source: '%s', destination: '%s'"), + featureName, + virTristateSwitchTypeToString(src->features= [i]), + virTristateSwitchTypeToString(dst->features= [i])); + return false; + } + break; + + case VIR_DOMAIN_FEATURE_LAST: + break; } } =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935406305638.9650466500917; Tue, 6 Feb 2018 08:43:26 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 40622C036756; Tue, 6 Feb 2018 16:43:25 +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 136285C2E0; Tue, 6 Feb 2018 16:43: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 B110C4A46E; Tue, 6 Feb 2018 16:43:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhNXw008472 for ; Tue, 6 Feb 2018 11:43:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id CCFA76046C; Tue, 6 Feb 2018 16:43:23 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FE005C461 for ; Tue, 6 Feb 2018 16:43:22 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:54 +0100 Message-Id: <20180206164300.13450-6-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/11] conf: Validate VIR_DOMAIN_FEATURE_CAPABILITIES properly X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 06 Feb 2018 16:43:25 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Unlike most other features, VIR_DOMAIN_FEATURE_CAPABILITIES is of type virDomainCapabilitiesPolicy instead of virTristateSwitch, so we need to handle it separately for the error message to make sense. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e4d01b869..9f019c906 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21336,7 +21336,6 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, case VIR_DOMAIN_FEATURE_HYPERV: case VIR_DOMAIN_FEATURE_KVM: case VIR_DOMAIN_FEATURE_PVSPINLOCK: - case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_GIC: @@ -21355,6 +21354,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } break; =20 + case VIR_DOMAIN_FEATURE_CAPABILITIES: + if (src->features[i] !=3D dst->features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s:%s' differs: " + "source: '%s', destination: '%s'"), + featureName, "policy", + virDomainCapabilitiesPolicyTypeToString(src= ->features[i]), + virDomainCapabilitiesPolicyTypeToString(dst= ->features[i])); + return false; + } + break; + case VIR_DOMAIN_FEATURE_LAST: break; } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935408767768.7892659529281; Tue, 6 Feb 2018 08:43:28 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD1A172665; Tue, 6 Feb 2018 16:43:27 +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 AE60C5E1C3; Tue, 6 Feb 2018 16:43:27 +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 6612818033E7; Tue, 6 Feb 2018 16:43:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhQWN008485 for ; Tue, 6 Feb 2018 11:43:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2639B6046C; Tue, 6 Feb 2018 16:43:26 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A103612A4B for ; Tue, 6 Feb 2018 16:43:23 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:55 +0100 Message-Id: <20180206164300.13450-7-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/11] conf: Integrate all features ABI checks in the switch X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 06 Feb 2018 16:43:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are a few stray checks which still live outside of the switch in virDomainDefFeaturesCheckABIStability() for no good reason. Move them inside the switch, and update the error messages to be consistent while at it. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 105 ++++++++++++++++++++++++++++-----------------= ---- 1 file changed, 60 insertions(+), 45 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9f019c906..170c56665 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21328,7 +21328,6 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, =20 switch ((virDomainFeature) i) { case VIR_DOMAIN_FEATURE_ACPI: - case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_VIRIDIAN: @@ -21338,10 +21337,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_VMPORT: - case VIR_DOMAIN_FEATURE_GIC: case VIR_DOMAIN_FEATURE_SMM: - case VIR_DOMAIN_FEATURE_IOAPIC: - case VIR_DOMAIN_FEATURE_HPT: case VIR_DOMAIN_FEATURE_VMCOREINFO: if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -21366,28 +21362,69 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, } break; =20 - case VIR_DOMAIN_FEATURE_LAST: + case VIR_DOMAIN_FEATURE_GIC: + if (src->features[i] !=3D dst->features[i] || + src->gic_version !=3D dst->gic_version) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s:%s' differs: " + "source: '%s:%s', destination: '%s:%s'"), + featureName, "version", + virTristateSwitchTypeToString(src->features= [i]), + virGICVersionTypeToString(src->gic_version), + virTristateSwitchTypeToString(dst->features= [i]), + virGICVersionTypeToString(dst->gic_version)= ); + return false; + } break; - } - } =20 - /* APIC EOI */ - if (src->apic_eoi !=3D dst->apic_eoi) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("State of APIC EOI differs: " - "source: '%s', destination: '%s'"), - virTristateSwitchTypeToString(src->apic_eoi), - virTristateSwitchTypeToString(dst->apic_eoi)); - return false; - } + case VIR_DOMAIN_FEATURE_HPT: + if (src->features[i] !=3D dst->features[i] || + src->hpt_resizing !=3D dst->hpt_resizing) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s:%s' differs: " + "source: '%s:%s', destination: '%s:%s'"), + featureName, "resizing", + virTristateSwitchTypeToString(src->features= [i]), + virDomainHPTResizingTypeToString(src->hpt_r= esizing), + virTristateSwitchTypeToString(dst->features= [i]), + virDomainHPTResizingTypeToString(dst->hpt_r= esizing)); + return false; + } + break; =20 - /* GIC version */ - if (src->gic_version !=3D dst->gic_version) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Source GIC version '%s' does not match destinati= on '%s'"), - virGICVersionTypeToString(src->gic_version), - virGICVersionTypeToString(dst->gic_version)); - return false; + case VIR_DOMAIN_FEATURE_APIC: + if (src->features[i] !=3D dst->features[i] || + src->apic_eoi !=3D dst->apic_eoi) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s:%s' differs: " + "source: '%s:%s', destination: '%s:%s'"), + featureName, "eoi", + virTristateSwitchTypeToString(src->features= [i]), + virTristateSwitchTypeToString(src->apic_eoi= ), + virTristateSwitchTypeToString(dst->features= [i]), + virTristateSwitchTypeToString(dst->apic_eoi= )); + return false; + } + break; + + case VIR_DOMAIN_FEATURE_IOAPIC: + if (src->features[i] !=3D dst->features[i] || + src->ioapic !=3D dst->ioapic) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s:%s' differs: " + "source: '%s:%s', destination: '%s:%s'"), + featureName, "driver", + virTristateSwitchTypeToString(src->features= [i]), + virDomainIOAPICTypeToString(src->ioapic), + virTristateSwitchTypeToString(dst->features= [i]), + virDomainIOAPICTypeToString(dst->ioapic)); + return false; + } + break; + + case VIR_DOMAIN_FEATURE_LAST: + break; + } } =20 /* hyperv */ @@ -21468,28 +21505,6 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } } =20 - /* ioapic */ - if (src->ioapic !=3D dst->ioapic) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("State of ioapic differs: " - "source: '%s', destination: '%s'"), - virDomainIOAPICTypeToString(src->ioapic), - virDomainIOAPICTypeToString(dst->ioapic)); - return false; - } - - /* HPT resizing */ - if (src->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWITCH_O= N) { - if (src->hpt_resizing !=3D dst->hpt_resizing) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("HPT resizing configuration differs: " - "source: '%s', destination: '%s'"), - virDomainHPTResizingTypeToString(src->hpt_resiz= ing), - virDomainHPTResizingTypeToString(dst->hpt_resiz= ing)); - return false; - } - } - return true; } =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935414412403.43389197377155; Tue, 6 Feb 2018 08:43:34 -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 90002C056826; Tue, 6 Feb 2018 16:43: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 52D0E5EE13; Tue, 6 Feb 2018 16:43:33 +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 16D5D4A470; Tue, 6 Feb 2018 16:43:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhT1r008499 for ; Tue, 6 Feb 2018 11:43:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0BD906046C; Tue, 6 Feb 2018 16:43:29 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8650764447 for ; Tue, 6 Feb 2018 16:43:26 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:56 +0100 Message-Id: <20180206164300.13450-8-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/11] tests: Improve GIC tests 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.32]); Tue, 06 Feb 2018 16:43:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Account for the fact that the default might change based on what GIC versions are supported by QEMU. That's not the case at the moment, but it will be soon. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- tests/qemuxml2argvdata/aarch64-gic-default-both.args | 1 + tests/qemuxml2argvdata/aarch64-gic-default-both.xml | 1 + tests/qemuxml2argvdata/aarch64-gic-default-v2.args | 1 + tests/qemuxml2argvdata/aarch64-gic-default-v2.xml | 1 + tests/qemuxml2argvdata/aarch64-gic-default-v3.args | 1 + tests/qemuxml2argvdata/aarch64-gic-default-v3.xml | 1 + tests/qemuxml2argvtest.c | 6 +++--- tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml | 1 + tests/qemuxml2xmloutdata/aarch64-gic-default-v2.xml | 1 + tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml | 1 + tests/qemuxml2xmltest.c | 6 +++--- 11 files changed, 15 insertions(+), 6 deletions(-) create mode 120000 tests/qemuxml2argvdata/aarch64-gic-default-both.args create mode 120000 tests/qemuxml2argvdata/aarch64-gic-default-both.xml create mode 120000 tests/qemuxml2argvdata/aarch64-gic-default-v2.args create mode 120000 tests/qemuxml2argvdata/aarch64-gic-default-v2.xml create mode 120000 tests/qemuxml2argvdata/aarch64-gic-default-v3.args create mode 120000 tests/qemuxml2argvdata/aarch64-gic-default-v3.xml create mode 120000 tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml create mode 120000 tests/qemuxml2xmloutdata/aarch64-gic-default-v2.xml create mode 120000 tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-both.args b/tests/q= emuxml2argvdata/aarch64-gic-default-both.args new file mode 120000 index 000000000..04ecd4ce7 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-gic-default-both.args @@ -0,0 +1 @@ +aarch64-gic-v2.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-both.xml b/tests/qe= muxml2argvdata/aarch64-gic-default-both.xml new file mode 120000 index 000000000..3e2183c92 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-gic-default-both.xml @@ -0,0 +1 @@ +aarch64-gic-default.xml \ No newline at end of file diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v2.args b/tests/qem= uxml2argvdata/aarch64-gic-default-v2.args new file mode 120000 index 000000000..04ecd4ce7 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-gic-default-v2.args @@ -0,0 +1 @@ +aarch64-gic-v2.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v2.xml b/tests/qemu= xml2argvdata/aarch64-gic-default-v2.xml new file mode 120000 index 000000000..3e2183c92 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-gic-default-v2.xml @@ -0,0 +1 @@ +aarch64-gic-default.xml \ No newline at end of file diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v3.args b/tests/qem= uxml2argvdata/aarch64-gic-default-v3.args new file mode 120000 index 000000000..04ecd4ce7 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-gic-default-v3.args @@ -0,0 +1 @@ +aarch64-gic-v2.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v3.xml b/tests/qemu= xml2argvdata/aarch64-gic-default-v3.xml new file mode 120000 index 000000000..3e2183c92 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-gic-default-v3.xml @@ -0,0 +1 @@ +aarch64-gic-default.xml \ No newline at end of file diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b7afb6980..dd64772e2 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2602,13 +2602,13 @@ mymain(void) DO_TEST_GIC("aarch64-gic-default", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_GIC("aarch64-gic-default", GIC_V2, + DO_TEST_GIC("aarch64-gic-default-v2", GIC_V2, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_GIC("aarch64-gic-default", GIC_V3, + DO_TEST_GIC("aarch64-gic-default-v3", GIC_V3, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_GIC("aarch64-gic-default", GIC_BOTH, + DO_TEST_GIC("aarch64-gic-default-both", GIC_BOTH, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); DO_TEST_GIC("aarch64-gic-v2", GIC_NONE, diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml b/tests/= qemuxml2xmloutdata/aarch64-gic-default-both.xml new file mode 120000 index 000000000..ee470fb1f --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/aarch64-gic-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-default-v2.xml b/tests/qe= muxml2xmloutdata/aarch64-gic-default-v2.xml new file mode 120000 index 000000000..ee470fb1f --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-gic-default-v2.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/aarch64-gic-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml b/tests/qe= muxml2xmloutdata/aarch64-gic-default-v3.xml new file mode 120000 index 000000000..ee470fb1f --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/aarch64-gic-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index d3544a1ef..83809574c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1265,9 +1265,9 @@ mymain(void) DO_TEST_FULL("aarch64-gic-none-both", WHEN_BOTH, GIC_BOTH, NONE); DO_TEST_FULL("aarch64-gic-none-tcg", WHEN_BOTH, GIC_BOTH, NONE); DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_NONE, NONE); - DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_V2, NONE); - DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_V3, NONE); - DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_BOTH, NONE); + DO_TEST_FULL("aarch64-gic-default-v2", WHEN_BOTH, GIC_V2, NONE); + DO_TEST_FULL("aarch64-gic-default-v3", WHEN_BOTH, GIC_V3, NONE); + DO_TEST_FULL("aarch64-gic-default-both", WHEN_BOTH, GIC_BOTH, NONE); DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_NONE, NONE); DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_V2, NONE); DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_V3, NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935421376803.3773787733377; Tue, 6 Feb 2018 08:43:41 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A6E328217; Tue, 6 Feb 2018 16:43:40 +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 607D15C66F; Tue, 6 Feb 2018 16:43:40 +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 1E07218033EF; Tue, 6 Feb 2018 16:43:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhcVV008534 for ; Tue, 6 Feb 2018 11:43:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id A8E4187AF; Tue, 6 Feb 2018 16:43:38 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F91B53E32 for ; Tue, 6 Feb 2018 16:43:29 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:57 +0100 Message-Id: <20180206164300.13450-9-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/11] qemu: Fix GIC behavior for the default case X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Feb 2018 16:43:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When no GIC version is specified, we currently default to GIC v2; however, that's not a great default, since guests will fail to start if the hardware only supports GIC v3. Change the behavior so that a sensible default is chosen instead. That basically means using the same algorithm whether the user didn't explicitly enable the GIC feature or they explicitly enabled it but didn't specify any GIC version. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 25 +++++++++++-------= ---- .../qemuxml2argvdata/aarch64-gic-default-both.args | 2 +- tests/qemuxml2argvdata/aarch64-gic-default-v3.args | 2 +- .../aarch64-gic-default-both.xml | 2 +- .../qemuxml2xmloutdata/aarch64-gic-default-v3.xml | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 98cba8789..ee720d328 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2838,13 +2838,14 @@ static void qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) { - virGICVersion version; - - /* The virt machine type always uses GIC: if the relevant element + /* The virt machine type always uses GIC: if the relevant information * was not included in the domain XML, we need to choose a suitable * GIC version ourselves */ - if (def->features[VIR_DOMAIN_FEATURE_GIC] =3D=3D VIR_TRISTATE_SWITCH_A= BSENT && - qemuDomainIsVirt(def)) { + if ((def->features[VIR_DOMAIN_FEATURE_GIC] =3D=3D VIR_TRISTATE_SWITCH_= ABSENT && + qemuDomainIsVirt(def)) || + (def->features[VIR_DOMAIN_FEATURE_GIC] =3D=3D VIR_TRISTATE_SWITCH_= ON && + def->gic_version =3D=3D VIR_GIC_VERSION_NONE)) { + virGICVersion version; =20 VIR_DEBUG("Looking for usable GIC version in domain capabilities"); for (version =3D VIR_GIC_VERSION_LAST - 1; @@ -2878,17 +2879,17 @@ qemuDomainDefEnableDefaultFeatures(virDomainDefPtr = def, } } =20 + /* Use the default GIC version (GICv2) as a last-ditch attempt + * if no match could be found above */ + if (def->gic_version =3D=3D VIR_GIC_VERSION_NONE) { + VIR_DEBUG("Using GIC version 2 (default)"); + def->gic_version =3D VIR_GIC_VERSION_2; + } + /* Even if we haven't found a usable GIC version in the domain * capabilities, we still want to enable this */ def->features[VIR_DOMAIN_FEATURE_GIC] =3D VIR_TRISTATE_SWITCH_ON; } - - /* Use the default GIC version (GICv2) if no version was specified */ - if (def->features[VIR_DOMAIN_FEATURE_GIC] =3D=3D VIR_TRISTATE_SWITCH_O= N && - def->gic_version =3D=3D VIR_GIC_VERSION_NONE) { - VIR_DEBUG("Using GIC version 2 (default)"); - def->gic_version =3D VIR_GIC_VERSION_2; - } } =20 =20 diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-both.args b/tests/q= emuxml2argvdata/aarch64-gic-default-both.args index 04ecd4ce7..6209eff4b 120000 --- a/tests/qemuxml2argvdata/aarch64-gic-default-both.args +++ b/tests/qemuxml2argvdata/aarch64-gic-default-both.args @@ -1 +1 @@ -aarch64-gic-v2.args \ No newline at end of file +aarch64-gic-v3.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v3.args b/tests/qem= uxml2argvdata/aarch64-gic-default-v3.args index 04ecd4ce7..6209eff4b 120000 --- a/tests/qemuxml2argvdata/aarch64-gic-default-v3.args +++ b/tests/qemuxml2argvdata/aarch64-gic-default-v3.args @@ -1 +1 @@ -aarch64-gic-v2.args \ No newline at end of file +aarch64-gic-v3.args \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml b/tests/= qemuxml2xmloutdata/aarch64-gic-default-both.xml index ee470fb1f..bf9d58c38 120000 --- a/tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml +++ b/tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml @@ -1 +1 @@ -../qemuxml2argvdata/aarch64-gic-v2.xml \ No newline at end of file +../qemuxml2argvdata/aarch64-gic-v3.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml b/tests/qe= muxml2xmloutdata/aarch64-gic-default-v3.xml index ee470fb1f..bf9d58c38 120000 --- a/tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml +++ b/tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml @@ -1 +1 @@ -../qemuxml2argvdata/aarch64-gic-v2.xml \ No newline at end of file +../qemuxml2argvdata/aarch64-gic-v3.xml \ No newline at end of file --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935438440194.91905005989076; Tue, 6 Feb 2018 08:43:58 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91B6F7EAA3; Tue, 6 Feb 2018 16:43:57 +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 6C2765E1AB; Tue, 6 Feb 2018 16:43:57 +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 314F618033F2; Tue, 6 Feb 2018 16:43:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhtS1008610 for ; Tue, 6 Feb 2018 11:43:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5732A6046C; Tue, 6 Feb 2018 16:43:55 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D19245C7AC for ; Tue, 6 Feb 2018 16:43:38 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:58 +0100 Message-Id: <20180206164300.13450-10-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/11] conf: Improve IOAPIC feature handling X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 06 Feb 2018 16:43:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of storing separately whether the feature is enabled or not and what driver should be used, store both of them in a single place. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 29 +++++++++++++---------------- src/conf/domain_conf.h | 11 ++++++----- src/qemu/qemu_command.c | 5 +++-- src/qemu/qemu_domain.c | 2 +- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 170c56665..19884ec13 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -900,6 +900,7 @@ VIR_ENUM_IMPL(virDomainLoader, =20 VIR_ENUM_IMPL(virDomainIOAPIC, VIR_DOMAIN_IOAPIC_LAST, + "none", "qemu", "kvm") =20 @@ -5913,8 +5914,7 @@ virDomainDefValidateInternal(const virDomainDef *def) =20 if (def->iommu && def->iommu->intremap =3D=3D VIR_TRISTATE_SWITCH_ON && - (def->features[VIR_DOMAIN_FEATURE_IOAPIC] !=3D VIR_TRISTATE_SWITCH= _ON || - def->ioapic !=3D VIR_DOMAIN_IOAPIC_QEMU)) { + def->features[VIR_DOMAIN_FEATURE_IOAPIC] !=3D VIR_DOMAIN_IOAPIC_QE= MU) { virReportError(VIR_ERR_XML_ERROR, "%s", _("IOMMU interrupt remapping requires split I/O API= C " "(ioapic driver=3D'qemu')")); @@ -19224,14 +19224,13 @@ virDomainDefParseXML(xmlDocPtr xml, tmp =3D virXMLPropString(nodes[i], "driver"); if (tmp) { int value =3D virDomainIOAPICTypeFromString(tmp); - if (value < 0) { + if (value < 0 || value =3D=3D VIR_DOMAIN_IOAPIC_NONE) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown driver mode: %s"), tmp); goto error; } - def->ioapic =3D value; - def->features[val] =3D VIR_TRISTATE_SWITCH_ON; + def->features[val] =3D value; VIR_FREE(tmp); } break; @@ -21408,16 +21407,13 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, break; =20 case VIR_DOMAIN_FEATURE_IOAPIC: - if (src->features[i] !=3D dst->features[i] || - src->ioapic !=3D dst->ioapic) { + if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s:%s' differs: " - "source: '%s:%s', destination: '%s:%s'"), + "source: '%s', destination: '%s'"), featureName, "driver", - virTristateSwitchTypeToString(src->features= [i]), - virDomainIOAPICTypeToString(src->ioapic), - virTristateSwitchTypeToString(dst->features= [i]), - virDomainIOAPICTypeToString(dst->ioapic)); + virDomainIOAPICTypeToString(src->features[i= ]), + virDomainIOAPICTypeToString(dst->features[i= ])); return false; } break; @@ -26943,10 +26939,11 @@ virDomainDefFormatInternal(virDomainDefPtr def, break; =20 case VIR_DOMAIN_FEATURE_IOAPIC: - if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { - virBufferAsprintf(buf, "\n", - virDomainIOAPICTypeToString(def->ioa= pic)); - } + if (def->features[i] =3D=3D VIR_DOMAIN_IOAPIC_NONE) + break; + + virBufferAsprintf(buf, "\n", + virDomainIOAPICTypeToString(def->feature= s[i])); break; =20 case VIR_DOMAIN_FEATURE_HPT: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 21e004515..20f0efc36 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1861,7 +1861,8 @@ struct _virDomainLoaderDef { void virDomainLoaderDefFree(virDomainLoaderDefPtr loader); =20 typedef enum { - VIR_DOMAIN_IOAPIC_QEMU =3D 0, + VIR_DOMAIN_IOAPIC_NONE =3D 0, + VIR_DOMAIN_IOAPIC_QEMU, VIR_DOMAIN_IOAPIC_KVM, =20 VIR_DOMAIN_IOAPIC_LAST @@ -2352,9 +2353,10 @@ struct _virDomainDef { =20 virDomainOSDef os; char *emulator; - /* These three options are of type virTristateSwitch, - * except VIR_DOMAIN_FEATURE_CAPABILITIES that is of type - * virDomainCapabilitiesPolicy */ + /* Most of the values in {kvm_,hyperv_,}features are of type + * virTristateSwitch, but there are exceptions: for example, + * VIR_DOMAIN_FEATURE_CAPABILITIES is of type virDomainCapabilitiesPol= icy, + * VIR_DOMAIN_FEATURE_IOAPIC is of type virDomainIOAPIC and so on */ int features[VIR_DOMAIN_FEATURE_LAST]; int apic_eoi; int hyperv_features[VIR_DOMAIN_HYPERV_LAST]; @@ -2362,7 +2364,6 @@ struct _virDomainDef { unsigned int hyperv_spinlocks; virGICVersion gic_version; char *hyperv_vendor_id; - virDomainIOAPIC ioapic; virDomainHPTResizing hpt_resizing; =20 /* These options are of type virTristateSwitch: ON =3D keep, OFF =3D d= rop */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 529079be0..3aabdf7a2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7240,14 +7240,14 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } } =20 - if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D=3D VIR_TRISTATE_S= WITCH_ON) { + if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] !=3D VIR_DOMAIN_IOAPI= C_NONE) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP= )) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("I/O APIC tuning is not supported by this= " "QEMU binary")); goto cleanup; } - switch (def->ioapic) { + switch ((virDomainIOAPIC) def->features[VIR_DOMAIN_FEATURE_IOA= PIC]) { case VIR_DOMAIN_IOAPIC_QEMU: if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQ= CHIP_SPLIT)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -7260,6 +7260,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, case VIR_DOMAIN_IOAPIC_KVM: virBufferAddLit(&buf, ",kernel_irqchip=3Don"); break; + case VIR_DOMAIN_IOAPIC_NONE: case VIR_DOMAIN_IOAPIC_LAST: break; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ee720d328..cfea1f500 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3234,7 +3234,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) =20 switch ((virDomainFeature) i) { case VIR_DOMAIN_FEATURE_IOAPIC: - if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && + if (def->features[i] !=3D VIR_DOMAIN_IOAPIC_NONE && !ARCH_IS_X86(def->os.arch)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("The '%s' feature is only supported for %= s guests"), --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935441751369.875823125343; Tue, 6 Feb 2018 08:44:01 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A51928225; Tue, 6 Feb 2018 16:44:00 +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 6B8DC5C892; Tue, 6 Feb 2018 16:44:00 +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 3194518033F6; Tue, 6 Feb 2018 16:44:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16GhxPG008644 for ; Tue, 6 Feb 2018 11:43:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 34B4C6046C; Tue, 6 Feb 2018 16:43:59 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF7065C461 for ; Tue, 6 Feb 2018 16:43:55 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:42:59 +0100 Message-Id: <20180206164300.13450-11-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/11] conf: Improve HPT feature handling X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Feb 2018 16:44:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of storing separately whether the feature is enabled or not and what resizing policy should be used, store both of them in a single place. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 26 ++++++++++++-------------- src/conf/domain_conf.h | 4 ++-- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 2 +- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 19884ec13..c1d549594 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -906,6 +906,7 @@ VIR_ENUM_IMPL(virDomainIOAPIC, =20 VIR_ENUM_IMPL(virDomainHPTResizing, VIR_DOMAIN_HPT_RESIZING_LAST, + "none", "enabled", "disabled", "required", @@ -19239,14 +19240,13 @@ virDomainDefParseXML(xmlDocPtr xml, tmp =3D virXMLPropString(nodes[i], "resizing"); if (tmp) { int value =3D virDomainHPTResizingTypeFromString(tmp); - if (value < 0) { + if (value < 0 || value =3D=3D VIR_DOMAIN_HPT_RESIZING_NONE= ) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown HPT resizing setting: %s"), tmp); goto error; } - def->hpt_resizing =3D value; - def->features[val] =3D VIR_TRISTATE_SWITCH_ON; + def->features[val] =3D value; VIR_FREE(tmp); } break; @@ -21377,16 +21377,13 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, break; =20 case VIR_DOMAIN_FEATURE_HPT: - if (src->features[i] !=3D dst->features[i] || - src->hpt_resizing !=3D dst->hpt_resizing) { + if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s:%s' differs: " - "source: '%s:%s', destination: '%s:%s'"), + "source: '%s', destination: '%s'"), featureName, "resizing", - virTristateSwitchTypeToString(src->features= [i]), - virDomainHPTResizingTypeToString(src->hpt_r= esizing), - virTristateSwitchTypeToString(dst->features= [i]), - virDomainHPTResizingTypeToString(dst->hpt_r= esizing)); + virDomainHPTResizingTypeToString(src->featu= res[i]), + virDomainHPTResizingTypeToString(dst->featu= res[i])); return false; } break; @@ -26947,10 +26944,11 @@ virDomainDefFormatInternal(virDomainDefPtr def, break; =20 case VIR_DOMAIN_FEATURE_HPT: - if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { - virBufferAsprintf(buf, "\n", - virDomainHPTResizingTypeToString(def= ->hpt_resizing)); - } + if (def->features[i] =3D=3D VIR_DOMAIN_HPT_RESIZING_NONE) + break; + + virBufferAsprintf(buf, "\n", + virDomainHPTResizingTypeToString(def->fe= atures[i])); break; =20 /* coverity[dead_error_begin] */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 20f0efc36..4e9044ae6 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1871,7 +1871,8 @@ typedef enum { VIR_ENUM_DECL(virDomainIOAPIC); =20 typedef enum { - VIR_DOMAIN_HPT_RESIZING_ENABLED =3D 0, + VIR_DOMAIN_HPT_RESIZING_NONE =3D 0, + VIR_DOMAIN_HPT_RESIZING_ENABLED, VIR_DOMAIN_HPT_RESIZING_DISABLED, VIR_DOMAIN_HPT_RESIZING_REQUIRED, =20 @@ -2364,7 +2365,6 @@ struct _virDomainDef { unsigned int hyperv_spinlocks; virGICVersion gic_version; char *hyperv_vendor_id; - virDomainHPTResizing hpt_resizing; =20 /* These options are of type virTristateSwitch: ON =3D keep, OFF =3D d= rop */ int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST]; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3aabdf7a2..faf09a599 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7266,7 +7266,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } } =20 - if (def->features[VIR_DOMAIN_FEATURE_HPT] =3D=3D VIR_TRISTATE_SWIT= CH_ON) { + if (def->features[VIR_DOMAIN_FEATURE_HPT] !=3D VIR_DOMAIN_HPT_RESI= ZING_NONE) { const char *str; =20 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE= _HPT)) { @@ -7276,7 +7276,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, goto cleanup; } =20 - str =3D virDomainHPTResizingTypeToString(def->hpt_resizing); + str =3D virDomainHPTResizingTypeToString(def->features[VIR_DOM= AIN_FEATURE_HPT]); 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 cfea1f500..5d21d3703 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3244,7 +3244,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) break; =20 case VIR_DOMAIN_FEATURE_HPT: - if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && + if (def->features[i] !=3D VIR_DOMAIN_HPT_RESIZING_NONE && !qemuDomainIsPSeries(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("The '%s' feature is only supported for %= s guests"), --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 02:20:56 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 1517935448239477.37603995387803; Tue, 6 Feb 2018 08:44: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 5A1BE793C9; Tue, 6 Feb 2018 16:44:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28D235C7AC; Tue, 6 Feb 2018 16:44:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E504618033F9; Tue, 6 Feb 2018 16:44:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w16Gi5Iu008695 for ; Tue, 6 Feb 2018 11:44:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id EECCE9CAF; Tue, 6 Feb 2018 16:44:05 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74E3960462 for ; Tue, 6 Feb 2018 16:43:59 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 6 Feb 2018 17:43:00 +0100 Message-Id: <20180206164300.13450-12-abologna@redhat.com> In-Reply-To: <20180206164300.13450-1-abologna@redhat.com> References: <20180206164300.13450-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/11] tests: Clean up HPT tests X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 06 Feb 2018 16:44:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Give them better names and remove some redundancy. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- ...es-hpt-resizing.args =3D> pseries-features-hpt.args} | 1 - .../pseries-features-hpt.xml} | 0 ...chine.xml =3D> pseries-features-invalid-machine.xml} | 2 +- tests/qemuxml2argvdata/pseries-hpt-resizing.xml | 19 ---------------= ---- tests/qemuxml2argvtest.c | 11 +++-------- tests/qemuxml2xmloutdata/pseries-features-hpt.xml | 1 + tests/qemuxml2xmltest.c | 3 +-- 7 files changed, 6 insertions(+), 31 deletions(-) rename tests/qemuxml2argvdata/{pseries-hpt-resizing.args =3D> pseries-feat= ures-hpt.args} (96%) rename tests/{qemuxml2xmloutdata/pseries-hpt-resizing.xml =3D> qemuxml2arg= vdata/pseries-features-hpt.xml} (100%) rename tests/qemuxml2argvdata/{pseries-hpt-resizing-invalid-machine.xml = =3D> pseries-features-invalid-machine.xml} (86%) delete mode 100644 tests/qemuxml2argvdata/pseries-hpt-resizing.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features-hpt.xml diff --git a/tests/qemuxml2argvdata/pseries-hpt-resizing.args b/tests/qemux= ml2argvdata/pseries-features-hpt.args similarity index 96% rename from tests/qemuxml2argvdata/pseries-hpt-resizing.args rename to tests/qemuxml2argvdata/pseries-features-hpt.args index 994789a5e..8cdb32965 100644 --- a/tests/qemuxml2argvdata/pseries-hpt-resizing.args +++ b/tests/qemuxml2argvdata/pseries-features-hpt.args @@ -12,7 +12,6 @@ QEMU_AUDIO_DRV=3Dnone \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ -nographic \ --nodefconfig \ -nodefaults \ -chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ server,nowait \ diff --git a/tests/qemuxml2xmloutdata/pseries-hpt-resizing.xml b/tests/qemu= xml2argvdata/pseries-features-hpt.xml similarity index 100% rename from tests/qemuxml2xmloutdata/pseries-hpt-resizing.xml rename to tests/qemuxml2argvdata/pseries-features-hpt.xml diff --git a/tests/qemuxml2argvdata/pseries-hpt-resizing-invalid-machine.xm= l b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml similarity index 86% rename from tests/qemuxml2argvdata/pseries-hpt-resizing-invalid-machine.xml rename to tests/qemuxml2argvdata/pseries-features-invalid-machine.xml index 757fcc70e..5a6bb02d5 100644 --- a/tests/qemuxml2argvdata/pseries-hpt-resizing-invalid-machine.xml +++ b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml @@ -7,7 +7,7 @@ hvm - + diff --git a/tests/qemuxml2argvdata/pseries-hpt-resizing.xml b/tests/qemuxm= l2argvdata/pseries-hpt-resizing.xml deleted file mode 100644 index f9dc9cac9..000000000 --- a/tests/qemuxml2argvdata/pseries-hpt-resizing.xml +++ /dev/null @@ -1,19 +0,0 @@ - - guest - 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 - 524288 - 1 - - hvm - - - - - - - /usr/bin/qemu-system-ppc64 - - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index dd64772e2..3aa69fcee 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1891,17 +1891,12 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); =20 - DO_TEST("pseries-hpt-resizing", - QEMU_CAPS_NODEFCONFIG, + DO_TEST("pseries-features-hpt", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); - DO_TEST_FAILURE("pseries-hpt-resizing", - QEMU_CAPS_NODEFCONFIG, + DO_TEST_FAILURE("pseries-features-hpt", QEMU_CAPS_MACHINE_OPT); - DO_TEST_PARSE_ERROR("pseries-hpt-resizing-invalid-machine", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); + DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); =20 DO_TEST("pseries-serial-native", QEMU_CAPS_NODEFCONFIG, diff --git a/tests/qemuxml2xmloutdata/pseries-features-hpt.xml b/tests/qemu= xml2xmloutdata/pseries-features-hpt.xml new file mode 120000 index 000000000..bcaf2e6fe --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-features-hpt.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pseries-features-hpt.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 83809574c..0eb9e6c77 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -763,8 +763,7 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); =20 - DO_TEST("pseries-hpt-resizing", - QEMU_CAPS_NODEFCONFIG, + DO_TEST("pseries-features-hpt", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list