[PATCH 13/14] qemu: Assume QEMU_CAPS_FW_CFG

Peter Krempa pkrempa at redhat.com
Mon Sep 20 15:29:35 UTC 2021


qemu supports this since 81b2b81062 ("fw_cfg: insert fw_cfg file blobs
via qemu cmdline") released in qemu-v2.4.0 and it can't be compiled out.

Assume that the option always works and remove the corresponding check.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/qemu/qemu_validate.c | 12 ++----------
 tests/qemuxml2argvtest.c |  2 +-
 tests/qemuxml2xmltest.c  |  2 +-
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index c4b7269589..c94a4b2eb3 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -886,18 +886,10 @@ qemuValidateDomainDefConsole(const virDomainDef *def,


 static int
-qemuValidateDomainDefSysinfo(const virSysinfoDef *def,
-                             virQEMUCaps *qemuCaps)
+qemuValidateDomainDefSysinfo(const virSysinfoDef *def)
 {
     size_t i;

-    if (def->type == VIR_SYSINFO_FWCFG &&
-        !virQEMUCapsGet(qemuCaps, QEMU_CAPS_FW_CFG)) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("fw_cfg is not supported with this QEMU"));
-        return -1;
-    }
-
     for (i = 0; i < def->nfw_cfgs; i++) {
         const virSysinfoFWCfgDef *f = &def->fw_cfgs[i];

@@ -1239,7 +1231,7 @@ qemuValidateDomainDef(const virDomainDef *def,
     }

     for (i = 0; i < def->nsysinfo; i++) {
-        if (qemuValidateDomainDefSysinfo(def->sysinfo[i], qemuCaps) < 0)
+        if (qemuValidateDomainDefSysinfo(def->sysinfo[i]) < 0)
             return -1;
     }

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 77e384f67c..947f73e78e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1864,7 +1864,7 @@ mymain(void)
     DO_TEST_NOCAPS("smbios");
     DO_TEST_PARSE_ERROR_NOCAPS("smbios-date");
     DO_TEST_PARSE_ERROR_NOCAPS("smbios-uuid-match");
-    DO_TEST("smbios-type-fwcfg", QEMU_CAPS_FW_CFG);
+    DO_TEST_NOCAPS("smbios-type-fwcfg");

     DO_TEST_NOCAPS("watchdog");
     DO_TEST_NOCAPS("watchdog-device");
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 05cb87bbd1..147a00d03f 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1107,7 +1107,7 @@ mymain(void)
             QEMU_CAPS_DEVICE_IVSHMEM_PLAIN, QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL);
     DO_TEST_NOCAPS("smbios");
     DO_TEST_NOCAPS("smbios-multiple-type2");
-    DO_TEST("smbios-type-fwcfg", QEMU_CAPS_FW_CFG);
+    DO_TEST_NOCAPS("smbios-type-fwcfg");

     DO_TEST_CAPS_LATEST("os-firmware-bios");
     DO_TEST_CAPS_LATEST("os-firmware-efi");
-- 
2.31.1




More information about the libvir-list mailing list