mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemu: Change return type of qemuDomainFixupCPUs to void
The function never fails. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
efac33bfaa
commit
6eb4c6ad20
@ -11050,29 +11050,27 @@ qemuDomainUpdateCPU(virDomainObj *vm,
|
||||
*
|
||||
* 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);
|
||||
@ -11093,8 +11091,6 @@ qemuDomainFixupCPUs(virDomainObj *vm,
|
||||
virCPUDefFree(*origCPU);
|
||||
*origCPU = g_steal_pointer(&fixedOrig);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -985,7 +985,7 @@ qemuDomainUpdateCPU(virDomainObj *vm,
|
||||
virCPUDef *cpu,
|
||||
virCPUDef **origCPU);
|
||||
|
||||
int
|
||||
void
|
||||
qemuDomainFixupCPUs(virDomainObj *vm,
|
||||
virCPUDef **origCPU);
|
||||
|
||||
|
@ -8278,9 +8278,8 @@ qemuProcessStartWithMemoryState(virConnectPtr conn,
|
||||
/* 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;
|
||||
@ -8926,8 +8925,7 @@ qemuProcessRefreshCPU(virQEMUDriver *driver,
|
||||
* 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user