From nobody Mon Feb 9 16:01:30 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 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