mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Use '-machine hpet=off' instead of '-no-hpet'
qemu is about to deprecate the '-no-hpet' option in favor of configuring the timer via '-machine'. Use the QEMU_CAPS_MACHINE_HPET capability to switch to the new syntax and mask out the old QEMU_CAPS_NO_HPET capability at the same time to prevent using the old syntax. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
3c508e7d43
commit
24cc9cda82
@ -5410,6 +5410,11 @@ virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps)
|
|||||||
* on a not entirely related witness. */
|
* on a not entirely related witness. */
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_JSON))
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_JSON))
|
||||||
virQEMUCapsSet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED);
|
virQEMUCapsSet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED);
|
||||||
|
|
||||||
|
/* Modern-style config of the HPET timer overrides support for the '-no-hpet'
|
||||||
|
* option */
|
||||||
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_HPET))
|
||||||
|
virQEMUCapsClear(qemuCaps, QEMU_CAPS_NO_HPET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5860,7 +5860,10 @@ qemuBuildClockCommandLine(virCommand *cmd,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_TIMER_NAME_HPET:
|
case VIR_DOMAIN_TIMER_NAME_HPET:
|
||||||
/* the only meaningful attribute for hpet is "present". If present
|
/* Modern qemu versions configure the HPET timer via -machine. See
|
||||||
|
* qemuBuildMachineCommandLine.
|
||||||
|
*
|
||||||
|
* the only meaningful attribute for hpet is "present". If present
|
||||||
* is VIR_TRISTATE_BOOL_ABSENT, that means it wasn't specified, and
|
* is VIR_TRISTATE_BOOL_ABSENT, that means it wasn't specified, and
|
||||||
* should be left at the default for the hypervisor. "default" when
|
* should be left at the default for the hypervisor. "default" when
|
||||||
* -no-hpet exists is VIR_TRISTATE_BOOL_YES, and when -no-hpet
|
* -no-hpet exists is VIR_TRISTATE_BOOL_YES, and when -no-hpet
|
||||||
@ -6744,6 +6747,7 @@ qemuBuildMachineCommandLine(virCommand *cmd,
|
|||||||
{
|
{
|
||||||
virCPUDef *cpu = def->cpu;
|
virCPUDef *cpu = def->cpu;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-machine");
|
virCommandAddArg(cmd, "-machine");
|
||||||
virBufferAdd(&buf, def->os.machine, -1);
|
virBufferAdd(&buf, def->os.machine, -1);
|
||||||
@ -6829,6 +6833,29 @@ qemuBuildMachineCommandLine(virCommand *cmd,
|
|||||||
virBufferAddLit(&buf, ",graphics=off");
|
virBufferAddLit(&buf, ",graphics=off");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < def->clock.ntimers; i++) {
|
||||||
|
switch ((virDomainTimerNameType)def->clock.timers[i]->name) {
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_HPET:
|
||||||
|
/* qemuBuildClockCommandLine handles the old-style config via '-no-hpet' */
|
||||||
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_HPET) &&
|
||||||
|
def->clock.timers[i]->present != VIR_TRISTATE_BOOL_ABSENT) {
|
||||||
|
virBufferAsprintf(&buf, ",hpet=%s",
|
||||||
|
virTristateSwitchTypeToString(def->clock.timers[i]->present));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_PLATFORM:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_TSC:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_KVMCLOCK:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_RTC:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_PIT:
|
||||||
|
case VIR_DOMAIN_TIMER_NAME_LAST:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
virCommandAddArgBuffer(cmd, &buf);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
<selfvers>0</selfvers>
|
<selfvers>0</selfvers>
|
||||||
<flag name='kvm'/>
|
<flag name='kvm'/>
|
||||||
<flag name='sdl'/>
|
<flag name='sdl'/>
|
||||||
<flag name='no-hpet'/>
|
|
||||||
<flag name='spice'/>
|
<flag name='spice'/>
|
||||||
<flag name='hda-duplex'/>
|
<flag name='hda-duplex'/>
|
||||||
<flag name='ccid-emulated'/>
|
<flag name='ccid-emulated'/>
|
||||||
|
@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-virt-manager-basic/.config \
|
|||||||
-name guest=virt-manager-basic,debug-threads=on \
|
-name guest=virt-manager-basic,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-virt-manager-basic/master-key.aes"}' \
|
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-virt-manager-basic/master-key.aes"}' \
|
||||||
-machine q35,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram \
|
-machine q35,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram,hpet=off \
|
||||||
-accel kvm \
|
-accel kvm \
|
||||||
-cpu qemu64 \
|
-cpu qemu64 \
|
||||||
-m 4096 \
|
-m 4096 \
|
||||||
@ -24,7 +24,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-virt-manager-basic/.config \
|
|||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
-rtc base=utc,driftfix=slew \
|
-rtc base=utc,driftfix=slew \
|
||||||
-global kvm-pit.lost_tick_policy=delay \
|
-global kvm-pit.lost_tick_policy=delay \
|
||||||
-no-hpet \
|
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
-global ICH9-LPC.disable_s3=1 \
|
-global ICH9-LPC.disable_s3=1 \
|
||||||
-global ICH9-LPC.disable_s4=1 \
|
-global ICH9-LPC.disable_s4=1 \
|
||||||
|
@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-name guest=guest,debug-threads=on \
|
-name guest=guest,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
||||||
-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \
|
-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,hpet=off \
|
||||||
-accel tcg \
|
-accel tcg \
|
||||||
-cpu qemu64 \
|
-cpu qemu64 \
|
||||||
-m 4096 \
|
-m 4096 \
|
||||||
@ -24,7 +24,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
-rtc base=utc,driftfix=slew \
|
-rtc base=utc,driftfix=slew \
|
||||||
-global kvm-pit.lost_tick_policy=delay \
|
-global kvm-pit.lost_tick_policy=delay \
|
||||||
-no-hpet \
|
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
-global PIIX4_PM.disable_s3=1 \
|
-global PIIX4_PM.disable_s3=1 \
|
||||||
-global PIIX4_PM.disable_s4=1 \
|
-global PIIX4_PM.disable_s4=1 \
|
||||||
|
@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-name guest=guest,debug-threads=on \
|
-name guest=guest,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
||||||
-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \
|
-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,hpet=off \
|
||||||
-accel tcg \
|
-accel tcg \
|
||||||
-cpu qemu64 \
|
-cpu qemu64 \
|
||||||
-m 4096 \
|
-m 4096 \
|
||||||
@ -25,7 +25,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
-rtc base=utc,driftfix=slew \
|
-rtc base=utc,driftfix=slew \
|
||||||
-global kvm-pit.lost_tick_policy=delay \
|
-global kvm-pit.lost_tick_policy=delay \
|
||||||
-no-hpet \
|
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
-global PIIX4_PM.disable_s3=1 \
|
-global PIIX4_PM.disable_s3=1 \
|
||||||
-global PIIX4_PM.disable_s4=1 \
|
-global PIIX4_PM.disable_s4=1 \
|
||||||
|
@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-name guest=guest,debug-threads=on \
|
-name guest=guest,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
||||||
-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram \
|
-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,hpet=off \
|
||||||
-accel tcg \
|
-accel tcg \
|
||||||
-cpu qemu64 \
|
-cpu qemu64 \
|
||||||
-m 4096 \
|
-m 4096 \
|
||||||
@ -24,7 +24,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
-rtc base=utc,driftfix=slew \
|
-rtc base=utc,driftfix=slew \
|
||||||
-global kvm-pit.lost_tick_policy=delay \
|
-global kvm-pit.lost_tick_policy=delay \
|
||||||
-no-hpet \
|
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
-global ICH9-LPC.disable_s3=1 \
|
-global ICH9-LPC.disable_s3=1 \
|
||||||
-global ICH9-LPC.disable_s4=1 \
|
-global ICH9-LPC.disable_s4=1 \
|
||||||
|
@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-name guest=guest,debug-threads=on \
|
-name guest=guest,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
||||||
-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram \
|
-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,hpet=off \
|
||||||
-accel tcg \
|
-accel tcg \
|
||||||
-cpu qemu64 \
|
-cpu qemu64 \
|
||||||
-m 4096 \
|
-m 4096 \
|
||||||
@ -25,7 +25,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
-rtc base=utc,driftfix=slew \
|
-rtc base=utc,driftfix=slew \
|
||||||
-global kvm-pit.lost_tick_policy=delay \
|
-global kvm-pit.lost_tick_policy=delay \
|
||||||
-no-hpet \
|
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
-global ICH9-LPC.disable_s3=1 \
|
-global ICH9-LPC.disable_s3=1 \
|
||||||
-global ICH9-LPC.disable_s4=1 \
|
-global ICH9-LPC.disable_s4=1 \
|
||||||
|
Loading…
Reference in New Issue
Block a user