[libvirt] [PATCH] 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. --- src/qemu/qemu_capabilities.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 668935e..01a1b98 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -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; } -- 1.8.0

On 12/07/2012 09:37 AM, Cole Robinson wrote:
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. --- src/qemu/qemu_capabilities.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 12/07/2012 12:59 PM, Eric Blake wrote:
On 12/07/2012 09:37 AM, Cole Robinson wrote:
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. --- src/qemu/qemu_capabilities.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
ACK.
Thanks Eric, pushed now. - Cole
participants (2)
-
Cole Robinson
-
Eric Blake