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:
parent
989a427de8
commit
3130541ebf
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user