]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: command: Format '-no-hpet' based on architecture check
authorPeter Krempa <pkrempa@redhat.com>
Mon, 6 Mar 2023 14:57:54 +0000 (15:57 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 7 Mar 2023 11:26:32 +0000 (12:26 +0100)
Rather than asserting a capability based on architecture, format the
fallback parameter based on the presence of the newer capability and an
explicit architecture check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c

index 189be555372ccf0279faaf446ceb8c6d8886b4f5..8d96f69f3de097c53326b82b6384a680c784cf49 100644 (file)
@@ -5936,9 +5936,11 @@ qemuBuildClockCommandLine(virCommand *cmd,
              * -no-hpet exists is VIR_TRISTATE_BOOL_YES, and when -no-hpet
              *  doesn't exist is VIR_TRISTATE_BOOL_NO. "confusing"?  "yes"! */
 
-            if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_HPET)) {
-                if (def->clock.timers[i]->present == VIR_TRISTATE_BOOL_NO)
-                    virCommandAddArg(cmd, "-no-hpet");
+            if (def->clock.timers[i]->present == VIR_TRISTATE_BOOL_NO &&
+                !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_HPET) &&
+                (def->os.arch == VIR_ARCH_I686 ||
+                 def->os.arch == VIR_ARCH_X86_64)) {
+                virCommandAddArg(cmd, "-no-hpet");
             }
             break;
         }