cli: Add --memdev target.dynamicMemslots support for virtio-mem

Libvirt supports setting dynamicMemslots attribute for virtio-mem since
v10.1.0, Let's add it into virt-install. Eg:

virt-install \
......
--vcpu 2 \
--cpu cell0.cpus=0,cell0.memory=4194304,\
cell1.cpus=1,cell1.memory=4194304 \
--memory maxMemory=65536,maxMemory.slots=8 \
--memdev model=virtio-mem,\
target.node=0,\
target.block=2048,\
target.size=8192,\
target.dynamicMemslots=yes \
......

It results in the following domain XML snippet:
    <memory model='virtio-mem'>
      <target dynamicMemslots='yes'>
        ......
    </memory>

Signed-off-by: Lin Ma <lma@suse.de>
This commit is contained in:
Lin Ma
2025-01-05 17:46:04 +08:00
committed by Pavel Hrdina
parent 54dc858f79
commit 8564ace73a
4 changed files with 5 additions and 3 deletions

View File

@@ -123,7 +123,7 @@
</target>
</memory>
<memory model="virtio-mem">
<target>
<target dynamicMemslots="yes">
<size>524288</size>
<node>0</node>
<block>2048</block>
@@ -267,7 +267,7 @@
</target>
</memory>
<memory model="virtio-mem">
<target>
<target dynamicMemslots="yes">
<size>524288</size>
<node>0</node>
<block>2048</block>