mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
Honour error returned by virBitmapFormat
The code formatting NUMA args was ignoring the return value of virBitmapFormat, so on OOM, it would silently drop the NUMA cpumask arg. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
a4b0c75ce8
commit
b81f30566b
@ -6861,8 +6861,9 @@ qemuBuildNumaArgStr(const virDomainDefPtr def, virCommandPtr cmd)
|
||||
virCommandAddArg(cmd, "-numa");
|
||||
virBufferAsprintf(&buf, "node,nodeid=%d", def->cpu->cells[i].cellid);
|
||||
virBufferAddLit(&buf, ",cpus=");
|
||||
cpumask = virBitmapFormat(def->cpu->cells[i].cpumask);
|
||||
if (cpumask) {
|
||||
if (!(cpumask = virBitmapFormat(def->cpu->cells[i].cpumask)))
|
||||
goto cleanup;
|
||||
|
||||
/* Up through qemu 1.4, -numa does not accept a cpus
|
||||
* argument any more complex than start-stop.
|
||||
*
|
||||
@ -6876,7 +6877,6 @@ qemuBuildNumaArgStr(const virDomainDefPtr def, virCommandPtr cmd)
|
||||
goto cleanup;
|
||||
}
|
||||
virBufferAdd(&buf, cpumask, -1);
|
||||
}
|
||||
def->cpu->cells[i].mem = VIR_DIV_UP(def->cpu->cells[i].mem,
|
||||
1024) * 1024;
|
||||
virBufferAsprintf(&buf, ",mem=%d", def->cpu->cells[i].mem / 1024);
|
||||
|
Loading…
x
Reference in New Issue
Block a user