mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
Don't check return value of virBitmapNewCopy
The function will not fail any more. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6b18cafb1d
commit
faa88866f5
@ -1823,8 +1823,7 @@ virCapabilitiesInitResctrlMemory(virCapsPtr caps)
|
|||||||
if (virResctrlInfoGetMemoryBandwidth(caps->host.resctrl,
|
if (virResctrlInfoGetMemoryBandwidth(caps->host.resctrl,
|
||||||
bank->level, &node->control) > 0) {
|
bank->level, &node->control) > 0) {
|
||||||
node->id = bank->id;
|
node->id = bank->id;
|
||||||
if (!(node->cpus = virBitmapNewCopy(bank->cpus)))
|
node->cpus = virBitmapNewCopy(bank->cpus);
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (VIR_APPEND_ELEMENT(caps->host.memBW.nodes,
|
if (VIR_APPEND_ELEMENT(caps->host.memBW.nodes,
|
||||||
caps->host.memBW.nnodes, node) < 0) {
|
caps->host.memBW.nnodes, node) < 0) {
|
||||||
|
@ -20928,12 +20928,7 @@ virDomainResctrlNew(xmlNodePtr node,
|
|||||||
if (VIR_ALLOC(resctrl) < 0)
|
if (VIR_ALLOC(resctrl) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(resctrl->vcpus = virBitmapNewCopy(vcpus))) {
|
resctrl->vcpus = virBitmapNewCopy(vcpus);
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("failed to copy 'vcpus'"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
resctrl->alloc = virObjectRef(alloc);
|
resctrl->alloc = virObjectRef(alloc);
|
||||||
|
|
||||||
ret = g_steal_pointer(&resctrl);
|
ret = g_steal_pointer(&resctrl);
|
||||||
|
@ -582,8 +582,8 @@ virDomainNumatuneSet(virDomainNumaPtr numa,
|
|||||||
|
|
||||||
if (nodeset) {
|
if (nodeset) {
|
||||||
virBitmapFree(numa->memory.nodeset);
|
virBitmapFree(numa->memory.nodeset);
|
||||||
if (!(numa->memory.nodeset = virBitmapNewCopy(nodeset)))
|
numa->memory.nodeset = virBitmapNewCopy(nodeset);
|
||||||
return -1;
|
|
||||||
if (placement == -1)
|
if (placement == -1)
|
||||||
placement = VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC;
|
placement = VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC;
|
||||||
}
|
}
|
||||||
|
@ -4543,8 +4543,7 @@ qemuDomainPinVcpuLive(virDomainObjPtr vm,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(tmpmap = virBitmapNewCopy(cpumap)))
|
tmpmap = virBitmapNewCopy(cpumap);
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!(str = virBitmapFormat(cpumap)))
|
if (!(str = virBitmapFormat(cpumap)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -4782,10 +4781,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
virBitmapFree(def->cputune.emulatorpin);
|
virBitmapFree(def->cputune.emulatorpin);
|
||||||
def->cputune.emulatorpin = NULL;
|
def->cputune.emulatorpin = virBitmapNewCopy(pcpumap);
|
||||||
|
|
||||||
if (!(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
|
||||||
goto endjob;
|
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -4802,10 +4798,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
|||||||
|
|
||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
virBitmapFree(persistentDef->cputune.emulatorpin);
|
virBitmapFree(persistentDef->cputune.emulatorpin);
|
||||||
persistentDef->cputune.emulatorpin = NULL;
|
persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap);
|
||||||
|
|
||||||
if (!(persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
|
||||||
goto endjob;
|
|
||||||
|
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
@ -6424,8 +6424,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def,
|
|||||||
ssize_t next = -1;
|
ssize_t next = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!(map = virBitmapNewCopy(vcpus)))
|
map = virBitmapNewCopy(vcpus);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* make sure that all selected vcpus are in the correct state */
|
/* make sure that all selected vcpus are in the correct state */
|
||||||
while ((next = virBitmapNextSetBit(map, next)) >= 0) {
|
while ((next = virBitmapNextSetBit(map, next)) >= 0) {
|
||||||
|
@ -568,9 +568,6 @@ qemuMigrationCookieAddCaps(qemuMigrationCookiePtr mig,
|
|||||||
|
|
||||||
mig->caps->automatic = qemuMigrationParamsGetAlwaysOnCaps(party);
|
mig->caps->automatic = qemuMigrationParamsGetAlwaysOnCaps(party);
|
||||||
|
|
||||||
if (!mig->caps->supported || !mig->caps->automatic)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
mig->flags |= QEMU_MIGRATION_COOKIE_CAPS;
|
mig->flags |= QEMU_MIGRATION_COOKIE_CAPS;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2562,8 +2562,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
|
|||||||
if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
|
if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
} else if (vm->def->cputune.emulatorpin) {
|
} else if (vm->def->cputune.emulatorpin) {
|
||||||
if (!(cpumapToSet = virBitmapNewCopy(vm->def->cputune.emulatorpin)))
|
cpumapToSet = virBitmapNewCopy(vm->def->cputune.emulatorpin);
|
||||||
return -1;
|
|
||||||
} else {
|
} else {
|
||||||
settingAll = true;
|
settingAll = true;
|
||||||
if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
|
if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
|
||||||
|
@ -2743,10 +2743,7 @@ testDomainPinEmulator(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
virBitmapFree(def->cputune.emulatorpin);
|
virBitmapFree(def->cputune.emulatorpin);
|
||||||
def->cputune.emulatorpin = NULL;
|
def->cputune.emulatorpin = virBitmapNewCopy(pcpumap);
|
||||||
|
|
||||||
if (!(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -2422,9 +2422,8 @@ virStorageSourceCopy(const virStorageSource *src,
|
|||||||
!(def->srcpool = virStorageSourcePoolDefCopy(src->srcpool)))
|
!(def->srcpool = virStorageSourcePoolDefCopy(src->srcpool)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (src->features &&
|
if (src->features)
|
||||||
!(def->features = virBitmapNewCopy(src->features)))
|
def->features = virBitmapNewCopy(src->features);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (src->encryption &&
|
if (src->encryption &&
|
||||||
!(def->encryption = virStorageEncryptionCopy(src->encryption)))
|
!(def->encryption = virStorageEncryptionCopy(src->encryption)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user