qemu: command: Format '-no-hpet' based on architecture check

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>
This commit is contained in:
Peter Krempa 2023-03-06 15:57:54 +01:00
parent 53a8875f59
commit bf476875d8

View 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;
}