From nobody Sat Nov 23 12:00:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1730793993459465.93158007297893; Tue, 5 Nov 2024 00:06:33 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 555031399; Tue, 5 Nov 2024 03:06:32 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E447F138B; Tue, 5 Nov 2024 02:59:09 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id F048E11AF; Tue, 5 Nov 2024 02:58:59 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 407D91260 for ; Tue, 5 Nov 2024 02:58:33 -0500 (EST) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-190-M8Brz-IOPWqH1ujJPHQNXg-1; Tue, 05 Nov 2024 02:58:29 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 020B61955F57 for ; Tue, 5 Nov 2024 07:58:29 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3B757300018D for ; Tue, 5 Nov 2024 07:58:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730793512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fm78hNbPsHff9K2EyC3CAM546kJAONK9TsehsOq+9R4=; b=UdKhx9xNYJk33SgM+k46FKmx7jL0wbMA/cJqq7Ns+4W9rCMFeECCjjNDDHf62vJgid87Uu PCw18551LaizmoLXr1eWGG/SMcq1wvwPN4GEUluUbM1y1a/OB405l2j4POio0A1G/u/wfy wvY14GJGIQbea1kolQHH06Y5B8Rm8co= X-MC-Unique: M8Brz-IOPWqH1ujJPHQNXg-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 11/13] conf: Remove nonsensical requirement of nvram format matching firmware format Date: Tue, 5 Nov 2024 08:58:09 +0100 Message-ID: <131f7c7eb7040b8d84d8d62034d85901dba05ced.1730793407.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 42ND2333A5D5HGGHYGGGWSCLWPMYKS6O X-Message-ID-Hash: 42ND2333A5D5HGGHYGGGWSCLWPMYKS6O X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1730793994743116600 Content-Type: text/plain; charset="utf-8" The nvram image can have any supported format and there's no technical requirement of them having the same format. In fact the actual nvram image doesn't necessarily need to have the same format as the template if the user is willing to format it themselves (as libvirt is not going to convert it). Remove the nonsensical check and adjust tests. The test case required swapping around the format in order to work properly. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 10 ----- ...uto-efi-format-mismatch.x86_64-latest.args | 37 +++++++++++++++++ ...auto-efi-format-mismatch.x86_64-latest.err | 1 - ...auto-efi-format-mismatch.x86_64-latest.xml | 41 +++++++++++++++++++ .../firmware-auto-efi-format-mismatch.xml | 4 +- tests/qemuxmlconftest.c | 2 +- 6 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch= .x86_64-latest.args delete mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch= .x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch= .x86_64-latest.xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1439c6bdac..8acbea72f0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17270,16 +17270,6 @@ virDomainLoaderDefParseXML(virDomainLoaderDef *loa= der, loaderNode) < 0) return -1; - if (loader->nvram && - loader->format && loader->nvram->format && - loader->format !=3D loader->nvram->format) { - virReportError(VIR_ERR_XML_ERROR, - _("Format mismatch: loader.format=3D'%1$s' nvram.fo= rmat=3D'%2$s'"), - virStorageFileFormatTypeToString(loader->format), - virStorageFileFormatTypeToString(loader->nvram->for= mat)); - return -1; - } - return 0; } diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_64= -latest.args b/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_= 64-latest.args new file mode 100644 index 0000000000..1bdd482d71 --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_64-latest= .args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.sec= boot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"disca= rd":"unmap"}' \ +-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver"= :"raw","file":"libvirt-pflash0-storage"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_= VARS.fd","node-name":"libvirt-pflash1-storage","read-only":false}' \ +-machine pc-q35-4.0,usb=3Doff,smm=3Don,dump-guest-core=3Doff,memory-backen= d=3Dpc.ram,pflash0=3Dlibvirt-pflash0-format,pflash1=3Dlibvirt-pflash1-stora= ge,acpi=3Don \ +-accel kvm \ +-cpu qemu64 \ +-global driver=3Dcfi.pflash01,property=3Dsecure,value=3Don \ +-m size=3D1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}= ' \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=3Doff \ +-watchdog-action reset \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_64= -latest.err b/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_6= 4-latest.err deleted file mode 100644 index abfdfc4357..0000000000 --- a/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_64-latest= .err +++ /dev/null @@ -1 +0,0 @@ -XML error: Format mismatch: loader.format=3D'qcow2' nvram.format=3D'raw' diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_64= -latest.xml b/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_6= 4-latest.xml new file mode 100644 index 0000000000..79ab55751b --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-auto-efi-format-mismatch.x86_64-latest= .xml @@ -0,0 +1,41 @@ + + guest + 63840878-0deb-4095-97e6-fc444d9bc9fa + 1048576 + 1048576 + 1 + + hvm + + + + + /usr/share/edk2/ovmf/OVMF_CODE.secboot.fd + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + + +