From 22c681256bbd9e8c40c997f0af0ed84325f56572 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 20 Sep 2021 17:04:33 +0200 Subject: [PATCH] qemu: Assume QEMU_CAPS_FW_CFG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- 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 5db7832a1a..4fc344b493 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 1d262c23c1..18b7b0ecf1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1863,7 +1863,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 f9d20242fc..59d1e24289 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");