1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

qemu: capabilities: fix machine name/canonical swappage

Things are supposed to look like:

<machine canonical='pc-0.12'>pc</machine>

But are currently swapped. This can cause many VMs to revert to having
machine type='pc' which will affect save/restore across qemu upgrades.
This commit is contained in:
Cole Robinson 2012-12-07 11:30:34 -05:00
parent 989a427de8
commit 3130541ebf

View File

@ -2046,20 +2046,15 @@ qemuCapsProbeQMPMachineTypes(qemuCapsPtr caps,
for (i = 0 ; i < nmachines ; i++) {
if (machines[i]->alias) {
if (!(caps->machineAliases[i] = strdup(machines[i]->name))) {
virReportOOMError();
goto cleanup;
}
if (!(caps->machineTypes[i] = strdup(machines[i]->alias))) {
virReportOOMError();
goto cleanup;
}
} else {
if (!(caps->machineTypes[i] = strdup(machines[i]->name))) {
if (!(caps->machineAliases[i] = strdup(machines[i]->alias))) {
virReportOOMError();
goto cleanup;
}
}
if (!(caps->machineTypes[i] = strdup(machines[i]->name))) {
virReportOOMError();
goto cleanup;
}
if (machines[i]->isDefault)
defIdx = i;
}