提交 af78cb04 编写于 作者: M Maxim Nestratov 提交者: John Ferlan

qemu: Allow to specify pit timer tick policy=discard

Separate out the "policy=discard" into it's own specific
qemu command line.

We'll rename "kvm-pit-device" test case to be "kvm-pit-discard"
since it has the syntax we'd be using.
Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
上级 ef5c8bb4
...@@ -6261,9 +6261,15 @@ qemuBuildClockCommandLine(virCommandPtr cmd, ...@@ -6261,9 +6261,15 @@ qemuBuildClockCommandLine(virCommandPtr cmd,
return -1; return -1;
} }
break; break;
case VIR_DOMAIN_TIMER_TICKPOLICY_MERGE:
case VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD: case VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD:
/* no way to support these modes for pit in qemu */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM_PIT_TICK_POLICY))
virCommandAddArgList(cmd, "-global",
"kvm-pit.lost_tick_policy=discard", NULL);
else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_KVM_PIT))
virCommandAddArg(cmd, "-no-kvm-pit-reinjection");
break;
case VIR_DOMAIN_TIMER_TICKPOLICY_MERGE:
/* no way to support this mode for pit in qemu */
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported pit tickpolicy '%s'"), _("unsupported pit tickpolicy '%s'"),
virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy));
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<boot dev='hd'/> <boot dev='hd'/>
</os> </os>
<clock offset='utc'> <clock offset='utc'>
<timer name='pit' tickpolicy='delay'/> <timer name='pit' tickpolicy='discard'/>
</clock> </clock>
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot> <on_reboot>restart</on_reboot>
......
...@@ -2275,6 +2275,7 @@ mymain(void) ...@@ -2275,6 +2275,7 @@ mymain(void)
qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY); DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY);
DO_TEST("kvm-pit-discard", QEMU_CAPS_KVM_PIT_TICK_POLICY);
DO_TEST("panic", QEMU_CAPS_DEVICE_PANIC, DO_TEST("panic", QEMU_CAPS_DEVICE_PANIC,
QEMU_CAPS_NODEFCONFIG); QEMU_CAPS_NODEFCONFIG);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册