提交 03eeb84f 编写于 作者: J Jiri Denemark

qemu: Allow migration with invtsc if tsc frequency is set

Migration with invtsc is allowed by QEMU as long as TSC frequency is
explicitly specified.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 6cb8bf6a
......@@ -2473,12 +2473,29 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver,
return false;
if (vm->def->cpu) {
/* QEMU blocks migration and save with invariant TSC enabled */
/* QEMU blocks migration and save with invariant TSC enabled
* unless TSC frequency is explicitly set.
*/
if (virCPUCheckFeature(vm->def->os.arch, vm->def->cpu,
"invtsc") == 1) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain has 'invtsc' CPU feature"));
return false;
bool block = true;
for (i = 0; i < vm->def->clock.ntimers; i++) {
virDomainTimerDefPtr timer = vm->def->clock.timers[i];
if (timer->name == VIR_DOMAIN_TIMER_NAME_TSC &&
timer->frequency > 0) {
block = false;
break;
}
}
if (block) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain has 'invtsc' CPU feature but "
"TSC frequency is not specified"));
return false;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册