*
* This function can only be used on an active domain or when restoring a
* domain which was running.
- *
- * Returns 0 on success, -1 on error.
*/
-int
+void
qemuDomainFixupCPUs(virDomainObj *vm,
virCPUDef **origCPU)
{
virArch arch = vm->def->os.arch;
if (!ARCH_IS_X86(arch))
- return 0;
+ return;
if (!vm->def->cpu ||
vm->def->cpu->mode != VIR_CPU_MODE_CUSTOM ||
!vm->def->cpu->model)
- return 0;
+ return;
/* Missing origCPU means QEMU created exactly the same virtual CPU which
* we asked for or libvirt was too old to mess up the translation from
* host-model.
*/
if (!*origCPU)
- return 0;
+ return;
if (virCPUDefFindFeature(vm->def->cpu, "cmt")) {
g_autoptr(virCPUDef) fixedCPU = virCPUDefCopyWithoutModel(vm->def->cpu);
virCPUDefFree(*origCPU);
*origCPU = g_steal_pointer(&fixedOrig);
}
-
- return 0;
}
/* No cookie means libvirt which saved the domain was too old to mess up
* the CPU definitions.
*/
- if (cookie &&
- qemuDomainFixupCPUs(vm, &cookie->cpu) < 0)
- return -1;
+ if (cookie)
+ qemuDomainFixupCPUs(vm, &cookie->cpu);
if (cookie && !cookie->slirpHelper)
priv->disableSlirp = true;
* case the host-model is known to not contain features which QEMU
* doesn't know about.
*/
- if (qemuDomainFixupCPUs(vm, &priv->origCPU) < 0)
- return -1;
+ qemuDomainFixupCPUs(vm, &priv->origCPU);
}
return 0;