From: Peter Krempa Date: Mon, 6 Mar 2023 14:57:54 +0000 (+0100) Subject: qemu: command: Format '-no-hpet' based on architecture check X-Git-Tag: v9.2.0-rc1~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf476875d873a99e14c25c52f0a72f669a6bd1f9;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 189be55537..8d96f69f3d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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; }