https://bugzilla.redhat.com/show_bug.cgi?id=2161965
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_firmware.c | 14 ++++++++++----
.../firmware-auto-efi-aarch64.aarch64-latest.args | 8 ++++----
.../virtio-iommu-aarch64.aarch64-latest.args | 8 ++++----
.../firmware-auto-efi-aarch64.aarch64-latest.xml | 4 ++--
.../virtio-iommu-aarch64.aarch64-latest.xml | 4 ++--
5 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 01efb60e69..9de4166772 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1013,6 +1013,8 @@ qemuFirmwareEnsureNVRAM(virDomainDef *def,
if (format == VIR_STORAGE_FILE_RAW)
ext = ".fd";
+ if (format == VIR_STORAGE_FILE_QCOW2)
+ ext = ".qcow2";
loader->nvram->path = g_strdup_printf("%s/%s_VARS%s",
cfg->nvramDir, def->name,
@@ -1173,7 +1175,8 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
}
}
- if (STRNEQ(flash->executable.format, "raw")) {
+ if (STRNEQ(flash->executable.format, "raw") &&
+ STRNEQ(flash->executable.format, "qcow2")) {
VIR_DEBUG("Discarding loader with unsupported flash format
'%s'",
flash->executable.format);
return false;
@@ -1186,7 +1189,8 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
return false;
}
if (flash->mode == QEMU_FIRMWARE_FLASH_MODE_SPLIT) {
- if (STRNEQ(flash->nvram_template.format, "raw")) {
+ if (STRNEQ(flash->nvram_template.format, "raw") &&
+ STRNEQ(flash->nvram_template.format, "qcow2")) {
VIR_DEBUG("Discarding loader with unsupported nvram template format
'%s'",
flash->nvram_template.format);
return false;
@@ -1596,14 +1600,16 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
return -1;
if (loader &&
- loader->format != VIR_STORAGE_FILE_RAW) {
+ loader->format != VIR_STORAGE_FILE_RAW &&
+ loader->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported loader format '%s'"),
virStorageFileFormatTypeToString(loader->format));
return -1;
}
if (nvram &&
- nvram->format != VIR_STORAGE_FILE_RAW) {
+ nvram->format != VIR_STORAGE_FILE_RAW &&
+ nvram->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported nvram format '%s'"),
virStorageFileFormatTypeToString(nvram->format));
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-aarch64.aarch64-latest.args
b/tests/qemuxml2argvdata/firmware-auto-efi-aarch64.aarch64-latest.args
index 05b27e84e8..8ebd1b8a26 100644
--- a/tests/qemuxml2argvdata/firmware-auto-efi-aarch64.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-aarch64.aarch64-latest.args
@@ -10,10 +10,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-name guest=guest,debug-threads=on \
-S \
-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}'
\
--blockdev
'{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"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","auto-read-only":true,"discard":"unmap"}'
\
--blockdev
'{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}'
\
+-blockdev
'{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.qcow2","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"qcow2","file":"libvirt-pflash0-storage"}'
\
+-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.qcow2","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage"}'
\
-machine
virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format
\
-accel tcg \
-cpu cortex-a15 \
diff --git a/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
b/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
index a88078818d..4d2df70378 100644
--- a/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
@@ -10,10 +10,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-name guest=guest,debug-threads=on \
-S \
-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}'
\
--blockdev
'{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"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","auto-read-only":true,"discard":"unmap"}'
\
--blockdev
'{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}'
\
+-blockdev
'{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.qcow2","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"qcow2","file":"libvirt-pflash0-storage"}'
\
+-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.qcow2","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage"}'
\
-machine
virt-6.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format
\
-accel tcg \
-cpu cortex-a15 \
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-aarch64.aarch64-latest.xml
b/tests/qemuxml2xmloutdata/firmware-auto-efi-aarch64.aarch64-latest.xml
index b53f39a72e..2eb5ab05fe 100644
--- a/tests/qemuxml2xmloutdata/firmware-auto-efi-aarch64.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-auto-efi-aarch64.aarch64-latest.xml
@@ -6,8 +6,8 @@
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt-4.0'>hvm</type>
- <loader readonly='yes'
type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
- <nvram
template='/usr/share/AAVMF/AAVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <loader readonly='yes' type='pflash'
format='qcow2'>/usr/share/AAVMF/AAVMF_CODE.qcow2</loader>
+ <nvram template='/usr/share/AAVMF/AAVMF_VARS.qcow2'
format='qcow2'>/var/lib/libvirt/qemu/nvram/guest_VARS.qcow2</nvram>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.xml
b/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.xml
index 2813e742d1..9e4f81fde8 100644
--- a/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.xml
@@ -6,8 +6,8 @@
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64' machine='virt-6.0'>hvm</type>
- <loader readonly='yes'
type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
- <nvram
template='/usr/share/AAVMF/AAVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <loader readonly='yes' type='pflash'
format='qcow2'>/usr/share/AAVMF/AAVMF_CODE.qcow2</loader>
+ <nvram template='/usr/share/AAVMF/AAVMF_VARS.qcow2'
format='qcow2'>/var/lib/libvirt/qemu/nvram/guest_VARS.qcow2</nvram>
<boot dev='hd'/>
</os>
<features>
--
2.39.1