]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Automatically use NUMA memory size in case NUMA is enabled
authorPeter Krempa <pkrempa@redhat.com>
Wed, 18 Feb 2015 13:02:39 +0000 (14:02 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Mar 2015 13:32:20 +0000 (14:32 +0100)
Use the NUMA total instead of the configured size both in XML and for
uses in the code once NUMA is enabled for a domain.

One test case change is necessary as the rounding of the individual cell
sizes was not matching the rounding of the total size.

src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode.args

index d27d42b920cf14c2c8e1f567312300aa8ade5073..4ecb58c90fb1cc639cdb9042c8a2d3560bcace11 100644 (file)
@@ -6985,6 +6985,12 @@ virDomainParseMemoryLimit(const char *xpath,
 unsigned long long
 virDomainDefGetMemoryInitial(virDomainDefPtr def)
 {
+    unsigned long long ret;
+
+    /* return NUMA memory size total in case numa is enabled */
+    if ((ret = virDomainNumaGetMemorySize(def->numa)) > 0)
+        return ret;
+
     return def->mem.max_balloon;
 }
 
index 513d6576468f4725d8607282ac12971d84c71045..5dd7fcd2ef4e7c2742fd8e65b31190dca51d646b 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/kvm -S -M pc -m 24104 -smp 32 \
+/usr/bin/kvm -S -M pc -m 24105 -smp 32 \
 -object memory-backend-ram,id=ram-node0,size=20971520,host-nodes=3,\
 policy=preferred \
 -numa node,nodeid=0,cpus=0,memdev=ram-node0 \