Now that we ignore all firmwares that are not in raw format
while performing autoselection, we can have descriptors for
firmware builds in QCOW2 format without breaking anything.

Note that the descriptors are arranged so that they have the
highest priority on aarch64, but the lowest one on x86_64.
This matches the expectation that QCOW2 will quickly be
adopted as the default on aarch64, where its use produces
significant benefits in terms of memory usage, while x86_64
will likely stick with raw for the foreseeable future.

Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
---
 .../share/qemu/firmware/65-ovmf-qcow2.json    | 35 ++++++++++++++++++
 .../share/qemu/firmware/66-aavmf-qcow2.json   | 36 +++++++++++++++++++
 tests/qemufirmwaretest.c                      | 11 ++++--
 3 files changed, 80 insertions(+), 2 deletions(-)
 create mode 100644 
tests/qemufirmwaredata/usr/share/qemu/firmware/65-ovmf-qcow2.json
 create mode 100644 
tests/qemufirmwaredata/usr/share/qemu/firmware/66-aavmf-qcow2.json

diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/65-ovmf-qcow2.json 
b/tests/qemufirmwaredata/usr/share/qemu/firmware/65-ovmf-qcow2.json
new file mode 100644
index 0000000000..3a45cf70f2
--- /dev/null
+++ b/tests/qemufirmwaredata/usr/share/qemu/firmware/65-ovmf-qcow2.json
@@ -0,0 +1,35 @@
+{
+    "description": "UEFI firmware for x86_64 virtual machines (QCOW2 format)",
+    "interface-types": [
+        "uefi"
+    ],
+    "mapping": {
+        "device": "flash",
+        "mode": "split",
+        "executable": {
+            "filename": "/usr/share/OVMF/OVMF_CODE.qcow2",
+            "format": "qcow2"
+        },
+        "nvram-template": {
+            "filename": "/usr/share/OVMF/OVMF_VARS.qcow2",
+            "format": "qcow2"
+        }
+    },
+    "targets": [
+        {
+            "architecture": "x86_64",
+            "machines": [
+                "pc-i440fx-*",
+                "pc-q35-*"
+            ]
+        }
+    ],
+    "features": [
+        "acpi-s3",
+        "amd-sev",
+        "verbose-dynamic"
+    ],
+    "tags": [
+
+    ]
+}
diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/66-aavmf-qcow2.json 
b/tests/qemufirmwaredata/usr/share/qemu/firmware/66-aavmf-qcow2.json
new file mode 100644
index 0000000000..9d80971ee4
--- /dev/null
+++ b/tests/qemufirmwaredata/usr/share/qemu/firmware/66-aavmf-qcow2.json
@@ -0,0 +1,36 @@
+{
+    "description": "UEFI firmware for ARM64 virtual machines (QCOW2 format)",
+    "interface-types": [
+        "uefi"
+    ],
+    "mapping": {
+        "device": "flash",
+        "mode": "split",
+        "executable": {
+            "filename": "/usr/share/AAVMF/AAVMF_CODE.qcow2",
+            "format": "qcow2"
+        },
+        "nvram-template": {
+            "filename": "/usr/share/AAVMF/AAVMF_VARS.qcow2",
+            "format": "qcow2"
+        }
+    },
+    "targets": [
+        {
+            "architecture": "aarch64",
+            "machines": [
+                "virt-*"
+            ]
+        }
+    ],
+    "features": [
+
+    ],
+    "tags": [
+        "-a AARCH64",
+        "-p ArmVirtPkg/ArmVirtQemu.dsc",
+        "-t GCC48",
+        "-b DEBUG",
+        "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000"
+    ]
+}
diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c
index fc3416b2ae..6817c93d9a 100644
--- a/tests/qemufirmwaretest.c
+++ b/tests/qemufirmwaretest.c
@@ -73,6 +73,8 @@ testFWPrecedence(const void *opaque G_GNUC_UNUSED)
         PREFIX "/share/qemu/firmware/50-ovmf-sb-keys.json",
         PREFIX "/share/qemu/firmware/55-ovmf-sb-combined.json",
         PREFIX "/share/qemu/firmware/61-ovmf.json",
+        PREFIX "/share/qemu/firmware/65-ovmf-qcow2.json",
+        PREFIX "/share/qemu/firmware/66-aavmf-qcow2.json",
         PREFIX "/share/qemu/firmware/70-aavmf.json",
         NULL
     };
@@ -234,6 +236,8 @@ mymain(void)
     DO_PARSE_TEST("usr/share/qemu/firmware/55-ovmf-sb-combined.json");
     DO_PARSE_TEST("usr/share/qemu/firmware/60-ovmf-sb.json");
     DO_PARSE_TEST("usr/share/qemu/firmware/61-ovmf.json");
+    DO_PARSE_TEST("usr/share/qemu/firmware/65-ovmf-qcow2.json");
+    DO_PARSE_TEST("usr/share/qemu/firmware/66-aavmf-qcow2.json");
     DO_PARSE_TEST("usr/share/qemu/firmware/70-aavmf.json");
 
     if (virTestRun("QEMU FW precedence test", testFWPrecedence, NULL) < 0)
@@ -254,7 +258,8 @@ mymain(void)
 
     DO_SUPPORTED_TEST("pc-i440fx-3.1", VIR_ARCH_X86_64, false,
                       "/usr/share/seabios/bios-256k.bin:NULL:"
-                      
"/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd",
+                      
"/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:"
+                      
"/usr/share/OVMF/OVMF_CODE.qcow2:/usr/share/OVMF/OVMF_VARS.qcow2",
                       VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS,
                       VIR_DOMAIN_OS_DEF_FIRMWARE_EFI);
     DO_SUPPORTED_TEST("pc-i440fx-3.1", VIR_ARCH_I686, false,
@@ -265,13 +270,15 @@ mymain(void)
                       
"/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.secboot.fd:"
                       "/usr/share/OVMF/OVMF.sev.fd:NULL:"
                       "/usr/share/OVMF/OVMF.secboot.fd:NULL:"
-                      
"/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd",
+                      
"/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:"
+                      
"/usr/share/OVMF/OVMF_CODE.qcow2:/usr/share/OVMF/OVMF_VARS.qcow2",
                       VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS,
                       VIR_DOMAIN_OS_DEF_FIRMWARE_EFI);
     DO_SUPPORTED_TEST("pc-q35-3.1", VIR_ARCH_I686, false,
                       "/usr/share/seabios/bios-256k.bin:NULL",
                       VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS);
     DO_SUPPORTED_TEST("virt-3.1", VIR_ARCH_AARCH64, false,
+                      
"/usr/share/AAVMF/AAVMF_CODE.qcow2:/usr/share/AAVMF/AAVMF_VARS.qcow2:"
                       
"/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd",
                       VIR_DOMAIN_OS_DEF_FIRMWARE_EFI);
 
-- 
2.39.1

Reply via email to