conf: Allow specifying only the slot number for hotpluggable memory

Simplify handling of the 'dimm' address element by allowing to specify
the slot number only. This will allow libvirt to allocate slot numbers
before starting qemu.
This commit is contained in:
Peter Krempa committed 2016-11-10 17:36:55 +01:00
1 parent 4a298c7543
commit 810e9a8061
5 files changed
+24 -12

No files matched your search

@@ -15,6 +15,8 @@ QEMU_AUDIO_DRV=none \
mem-path=/dev/hugepages2M/libvirt/qemu,size=536870912,host-nodes=1-3,\
policy=bind \
-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
-object memory-backend-ram,id=memdimm1,size=536870912 \
-device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=2 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-nographic \
-nodefaults \
@@ -2,8 +2,8 @@
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
<memory unit='KiB'>743423</memory>
<currentMemory unit='KiB'>743423</currentMemory>
<memory unit='KiB'>7434230</memory>
<currentMemory unit='KiB'>7434230</currentMemory>
<vcpu placement='static' cpuset='0-1'>2</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
@@ -41,5 +41,12 @@
</target>
<address type='dimm' slot='0' base='0x100000000'/>
</memory>
<memory model='dimm'>
<target>
<size unit='KiB'>524287</size>
<node>0</node>
</target>
<address type='dimm' slot='2'/>
</memory>
</devices>
</domain>
+1 -1
View File
@@ -2096,7 +2096,7 @@ mymain(void)
DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("memory-hotplug-dimm-addr", QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_FILE);
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);