mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Don't verify CPU features with host-passthrough
Commit fba6bc4 introduced the non-migratable invtsc feature, breaking save/migration with host-model and host-passthrough. On hosts with this feature present it was automatically included in the CPU definition, regardless of QEMU support. Commit de0aeaf stopped including it by default for host-model, but failed to fix host-passthrough. This commit ignores checking of CPU features with host-passthrough, since we don't pass them to QEMU (only -cpu host is passed), allowing domains using host-passthrough that were saved with the broken version of libvirtd to be restored. https://bugzilla.redhat.com/show_bug.cgi?id=1147584
This commit is contained in:
parent
e26bbf49cc
commit
ec5f817f2e
@ -1714,7 +1714,8 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; def->cpu && i < def->cpu->nfeatures; i++) {
|
if (def->cpu && def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
|
||||||
|
for (i = 0; i < def->cpu->nfeatures; i++) {
|
||||||
virCPUFeatureDefPtr feature = &def->cpu->features[i];
|
virCPUFeatureDefPtr feature = &def->cpu->features[i];
|
||||||
|
|
||||||
if (feature->policy != VIR_CPU_FEATURE_REQUIRE)
|
if (feature->policy != VIR_CPU_FEATURE_REQUIRE)
|
||||||
@ -1728,6 +1729,7 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3787,6 +3787,11 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver,
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
/* no features are passed to QEMU with -cpu host
|
||||||
|
* so it makes no sense to verify them */
|
||||||
|
if (def->cpu && def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case VIR_ARCH_I686:
|
case VIR_ARCH_I686:
|
||||||
case VIR_ARCH_X86_64:
|
case VIR_ARCH_X86_64:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user