提交 3130541e 编写于 作者: C Cole Robinson

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.
上级 989a427d
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册