]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Change signature for virQEMUCapsSupportsI8042Toggle()
authorAndrea Bolognani <abologna@redhat.com>
Wed, 28 Aug 2024 12:43:49 +0000 (14:43 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 29 Aug 2024 07:44:51 +0000 (09:44 +0200)
We will soon need to use it in a context where we don't have
a virDomainDef handy.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_validate.c

index 2d53e87ff397d74241de91fca4521bb34253912e..bde28ad083e001ac8975e74668d6623c724a5dab 100644 (file)
@@ -6032,15 +6032,16 @@ virQEMUCapsSupportsI8042(virQEMUCaps *qemuCaps,
 
 bool
 virQEMUCapsSupportsI8042Toggle(virQEMUCaps *qemuCaps,
-                               const virDomainDef *def)
+                               const char *machine,
+                               const virArch arch)
 {
     if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_I8042_OPT))
         return false;
 
-    return qemuDomainIsI440FX(def) ||
-        qemuDomainIsQ35(def) ||
-        qemuDomainIsXenFV(def) ||
-        STREQ(def->os.machine, "isapc");
+    return qemuDomainMachineIsI440FX(machine, arch) ||
+           qemuDomainMachineIsQ35(machine, arch) ||
+           qemuDomainMachineIsXenFV(machine, arch) ||
+           STREQ(machine, "isapc");
 }
 
 
index 9c577c1505ef8c384ccf8c0f5d6daa9732b33ad0..5036d49aab88ce95bb424b306cf885d2fa5d8a96 100644 (file)
@@ -723,7 +723,8 @@ bool virQEMUCapsSupportsI8042(virQEMUCaps *qemuCaps,
                               const virDomainDef *def);
 
 bool virQEMUCapsSupportsI8042Toggle(virQEMUCaps *qemuCaps,
-                                    const virDomainDef *def);
+                                    const char *machine,
+                                    const virArch arch);
 
 const char *virQEMUCapsGetBinary(virQEMUCaps *qemuCaps);
 virArch virQEMUCapsGetArch(virQEMUCaps *qemuCaps);
index f74c538efe248605bdf81970a3fafe9e53358494..3c40f76c12650d83f7a69fac08832c1853a5cc1a 100644 (file)
@@ -258,7 +258,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
             }
 
             if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
-                !virQEMUCapsSupportsI8042Toggle(qemuCaps, def)) {
+                !virQEMUCapsSupportsI8042Toggle(qemuCaps, def->os.machine, def->os.arch)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("ps2 feature state cannot be controlled with this QEMU binary"));
                 return -1;