mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
qemu: Change return type of qemuDomainUpdateCPU 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
ba3c738b7a
commit
efac33bfaa
@ -11002,10 +11002,8 @@ virSaveCookieCallbacks virQEMUDriverDomainSaveCookie = {
|
||||
* for. The domain definition will either contain a copy of the original CPU
|
||||
* definition or a copy of @cpu in case the domain was already running and
|
||||
* we're just restoring a saved state or preparing for incoming migration.
|
||||
*
|
||||
* Returns 0 on success, -1 on error.
|
||||
*/
|
||||
int
|
||||
void
|
||||
qemuDomainUpdateCPU(virDomainObj *vm,
|
||||
virCPUDef *cpu,
|
||||
virCPUDef **origCPU)
|
||||
@ -11015,14 +11013,14 @@ qemuDomainUpdateCPU(virDomainObj *vm,
|
||||
*origCPU = NULL;
|
||||
|
||||
if (!vm->def->cpu)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION))
|
||||
return 0;
|
||||
return;
|
||||
|
||||
/* nothing to do if only topology part of CPU def is used */
|
||||
if (vm->def->cpu->mode == VIR_CPU_MODE_CUSTOM && !vm->def->cpu->model)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
VIR_DEBUG("Replacing CPU definition");
|
||||
|
||||
@ -11032,8 +11030,6 @@ qemuDomainUpdateCPU(virDomainObj *vm,
|
||||
vm->def->cpu = virCPUDefCopy(cpu);
|
||||
else
|
||||
vm->def->cpu = virCPUDefCopy(*origCPU);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -980,7 +980,7 @@ virStorageSource *qemuDomainGetStorageSourceByDevstr(const char *devstr,
|
||||
virDomainDef *def,
|
||||
virDomainBackupDef *backupdef);
|
||||
|
||||
int
|
||||
void
|
||||
qemuDomainUpdateCPU(virDomainObj *vm,
|
||||
virCPUDef *cpu,
|
||||
virCPUDef **origCPU);
|
||||
|
@ -5674,8 +5674,7 @@ qemuProcessInit(virQEMUDriver *driver,
|
||||
if (qemuProcessPrepareQEMUCaps(vm, driver->qemuCapsCache) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuDomainUpdateCPU(vm, updatedCPU, &origCPU) < 0)
|
||||
return -1;
|
||||
qemuDomainUpdateCPU(vm, updatedCPU, &origCPU);
|
||||
|
||||
if (qemuProcessStartValidate(driver, vm, priv->qemuCaps, flags) < 0)
|
||||
return -1;
|
||||
@ -9138,9 +9137,8 @@ qemuProcessReconnect(void *opaque)
|
||||
qemuDomainVcpuPersistOrder(obj->def);
|
||||
|
||||
/* Make sure the original CPU is always preserved in priv->origCPU. */
|
||||
if (!priv->origCPU &&
|
||||
qemuDomainUpdateCPU(obj, NULL, &priv->origCPU) < 0)
|
||||
goto error;
|
||||
if (!priv->origCPU)
|
||||
qemuDomainUpdateCPU(obj, NULL, &priv->origCPU);
|
||||
|
||||
if (qemuProcessRefreshCPU(driver, obj) < 0)
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user