mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 13:35:17 +00:00
qemuBuildMemoryBackendProps: Join two conditions
There are two compound conditions in qemuBuildMemoryBackendProps() and each one checks for nodemask for NULL first. Join them into one bigger block. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
7feed1613d
commit
450d932cd9
@ -3437,20 +3437,22 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nodemask) {
|
||||||
/* Make sure the requested nodeset is sensible */
|
/* Make sure the requested nodeset is sensible */
|
||||||
if (nodemask && !virNumaNodesetIsAvailable(nodemask))
|
if (!virNumaNodesetIsAvailable(nodemask))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* If mode is "restrictive", we should only use cgroups setting allowed memory
|
/* If mode is "restrictive", we should only use cgroups setting allowed memory
|
||||||
* nodes, and skip passing the host-nodes and policy parameters to QEMU command
|
* nodes, and skip passing the host-nodes and policy parameters to QEMU command
|
||||||
* line which means we will use system default memory policy. */
|
* line which means we will use system default memory policy. */
|
||||||
if (nodemask && mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
|
if (mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
|
||||||
if (virJSONValueObjectAdd(&props,
|
if (virJSONValueObjectAdd(&props,
|
||||||
"m:host-nodes", nodemask,
|
"m:host-nodes", nodemask,
|
||||||
"S:policy", qemuNumaPolicyTypeToString(mode),
|
"S:policy", qemuNumaPolicyTypeToString(mode),
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If none of the following is requested... */
|
/* If none of the following is requested... */
|
||||||
if (!needHugepage && !mem->sourceNodes && !nodeSpecified &&
|
if (!needHugepage && !mem->sourceNodes && !nodeSpecified &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user