]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Report better error when memory device source has wrong NUMA node
authorLuyao Huang <lhuang@redhat.com>
Wed, 25 Mar 2015 06:34:04 +0000 (14:34 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 25 Mar 2015 11:24:40 +0000 (12:24 +0100)
When starting a VM with hotpluggable memory devices the user may specify
an invalid source NUMA node. Libvirt would pass through the error from
qemu:

 # virsh start test3
 error: Failed to start domain test3
 error: internal error: process exited while connecting to monitor:
 2015-03-25T01:12:17.205913Z qemu-kvm: -object memory-backend-ram,id=memdimm0
 ,size=536870912,host-nodes=1-3,policy=bind: cannot bind memory to host NUMA nodes:
 Invalid argument

This patch adds a check that allows to report better error:

 # virsh start test3
 error: Failed to start domain test3
 error: configuration unsupported: NUMA node 1 is unavailable

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/qemu/qemu_command.c

index 99a19d6246238b2b5107007a386337967a27e85d..04c8df7232492e6b80d14a3e172e4f061b8c7988 100644 (file)
@@ -4757,6 +4757,8 @@ qemuBuildMemoryBackendStr(unsigned long long size,
     }
 
     if (nodemask) {
+        if (!virNumaNodesetIsAvailable(nodemask))
+            goto cleanup;
         if (virJSONValueObjectAdd(props,
                                   "m:host-nodes", nodemask,
                                   "S:policy", qemuNumaPolicyTypeToString(mode),