From bf476875d873a99e14c25c52f0a72f669a6bd1f9 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 6 Mar 2023 15:57:54 +0100 Subject: [PATCH] qemu: command: Format '-no-hpet' based on architecture check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/qemu/qemu_command.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; }