mirror of https://gitee.com/openkylin/libvirt.git
conf: Automatically use NUMA memory size in case NUMA is enabled
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.
This commit is contained in:
parent
57b215ab25
commit
caf88a3c88
|
@ -6985,6 +6985,12 @@ virDomainParseMemoryLimit(const char *xpath,
|
||||||
unsigned long long
|
unsigned long long
|
||||||
virDomainDefGetMemoryInitial(virDomainDefPtr def)
|
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;
|
return def->mem.max_balloon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
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,\
|
-object memory-backend-ram,id=ram-node0,size=20971520,host-nodes=3,\
|
||||||
policy=preferred \
|
policy=preferred \
|
||||||
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
|
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
|
||||||
|
|
Loading…
Reference in New Issue