mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03: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;
|
||||
}
|
||||
|
||||
if (nodemask) {
|
||||
/* Make sure the requested nodeset is sensible */
|
||||
if (nodemask && !virNumaNodesetIsAvailable(nodemask))
|
||||
if (!virNumaNodesetIsAvailable(nodemask))
|
||||
return -1;
|
||||
|
||||
/* 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
|
||||
* 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,
|
||||
"m:host-nodes", nodemask,
|
||||
"S:policy", qemuNumaPolicyTypeToString(mode),
|
||||
NULL) < 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If none of the following is requested... */
|
||||
if (!needHugepage && !mem->sourceNodes && !nodeSpecified &&
|
||||
|
Loading…
Reference in New Issue
Block a user