From nobody Mon Feb 9 09:08:48 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 ARC-Seal: i=1; a=rsa-sha256; t=1563003021; cv=none; d=zoho.com; s=zohoarc; b=PSN94Ou3bGQh9rxle/PvJXU2i5kX1hWo7qnWr3VT+9ogAWxrIfKUPWsk4MPfL6+Bk96KPPbFaI3YJDHWpUMfueqygl8e6Tl+SzTCKbMdyo8he/wpRxqPhUG4kDVWSYM8kdSMIrdrjwXfhFH0D98FR3f9YIPooirRcX3mL97HZQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563003021; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=7Bl6agmVw9JNfhThfKd5ugdNExhelTBu/bOS1cHfJUw=; b=FMQmLz9hfQWjPop1JY2vrXxo0V+p+msiy10p4hA9rDNyslM/dwQhIKBFvIvINrw4KlRt6mXncCVCVcG2k9DeSzXioP5d4N+kCGroGUnAiqeexyTzgxUEDwYzE4ZWvd8iJY73rMaYska2nPDv8Cea6lfeC2T2YSfiJwRdXy0Zp54= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563003021146470.178023009704; Sat, 13 Jul 2019 00:30:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F60CA1007; Sat, 13 Jul 2019 07:30:17 +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 5934D196E5; Sat, 13 Jul 2019 07:30:15 +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 EF17718184AC; Sat, 13 Jul 2019 07:30:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6D7UAmO008975 for ; Sat, 13 Jul 2019 03:30:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3BD5A196A0; Sat, 13 Jul 2019 07:30:10 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-18.brq.redhat.com [10.40.204.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29742196AB; Sat, 13 Jul 2019 07:30:06 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Sat, 13 Jul 2019 09:29:59 +0200 Message-Id: <815c984bde606cf6b11f506478ed8d56eab233ad.1563002999.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: abologna@redhat.com Subject: [libvirt] [PATCH] qemu: Relax os.loader->type check when validating domain 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 13 Jul 2019 07:30:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When validating a domain among all the checks there are two that concern VIR_DOMAIN_LOADER_TYPE_PFLASH specifically. The first check ensures that on x86 ACPI is enabled when UEFI is requested, the second ensures that UEFI is used when ACPI is requested on aarch64. However, check for UEFI is done by plain comparison of def->os.loader->type which is insufficient because we have def->os.firmware too. NB, this wouldn't be a problem for active domain, because on startup process def->os.loader->type gets filled by qemuFirmwareEnableFeatures(), but that's not the case for inactive domains. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D1729604 Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0f1fda2384..ed33e31699 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4221,8 +4221,9 @@ qemuDomainDefValidate(const virDomainDef *def, } =20 /* On x86, UEFI requires ACPI */ - if (def->os.loader && - def->os.loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_PFLASH && + if ((def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI || + (def->os.loader && + def->os.loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_PFLASH)) && ARCH_IS_X86(def->os.arch) && def->features[VIR_DOMAIN_FEATURE_ACPI] !=3D VIR_TRISTATE_SWITCH_ON= ) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4233,8 +4234,9 @@ qemuDomainDefValidate(const virDomainDef *def, /* On aarch64, ACPI requires UEFI */ if (def->features[VIR_DOMAIN_FEATURE_ACPI] =3D=3D VIR_TRISTATE_SWITCH_= ON && def->os.arch =3D=3D VIR_ARCH_AARCH64 && - (!def->os.loader || - def->os.loader->type !=3D VIR_DOMAIN_LOADER_TYPE_PFLASH)) { + (def->os.firmware !=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI && + (!def->os.loader || + def->os.loader->type !=3D VIR_DOMAIN_LOADER_TYPE_PFLASH))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("ACPI requires UEFI on this architecture")); goto cleanup; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list