aboutsummaryrefslogtreecommitdiff
path: root/backends/hostmem.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-06-02 10:25:55 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-06-02 10:25:55 +0100
commitcccdd8c7971896c339d59c9c5d4647d4ffd9568a (patch)
tree65255ee490670b27b78b574d08f36b33192e6877 /backends/hostmem.c
parent853a60b87024b2f5d7c0c54a432d7798cb679900 (diff)
parent70b6d525dfb51d5e523d568d1139fc051bc223c5 (diff)
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
machine queue, 2020-05-13 Bug fixes: * hostmem: don't use mbind() if host-nodes is empty (Igor Mammedov) # gpg: Signature made Wed 13 May 2020 15:00:25 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: hostmem: don't use mbind() if host-nodes is empty Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'backends/hostmem.c')
-rw-r--r--backends/hostmem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 4ee4354898..61e3255f5c 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -383,8 +383,10 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
assert(sizeof(backend->host_nodes) >=
BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long));
assert(maxnode <= MAX_NODES);
- if (mbind(ptr, sz, backend->policy,
- maxnode ? backend->host_nodes : NULL, maxnode + 1, flags)) {
+
+ if (maxnode &&
+ mbind(ptr, sz, backend->policy, backend->host_nodes, maxnode + 1,
+ flags)) {
if (backend->policy != MPOL_DEFAULT || errno != ENOSYS) {
error_setg_errno(errp, errno,
"cannot bind memory to host NUMA nodes");