From 16fecb482a8a40f52e42a0b3909292ab4fedef4d Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 26 Jan 2022 18:03:57 -0500 Subject: [PATCH] cli: Add --memdev target.{current,block,requested} Signed-off-by: Cole Robinson --- tests/data/cli/compare/virt-install-memory-hotplug.xml | 6 ++++++ tests/test_cli.py | 2 +- virtinst/cli.py | 3 +++ virtinst/devices/memory.py | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/data/cli/compare/virt-install-memory-hotplug.xml b/tests/data/cli/compare/virt-install-memory-hotplug.xml index 897a6c475..d69c84adb 100644 --- a/tests/data/cli/compare/virt-install-memory-hotplug.xml +++ b/tests/data/cli/compare/virt-install-memory-hotplug.xml @@ -59,6 +59,9 @@ + 2048 + 524288 + 1048576 @@ -123,6 +126,9 @@ + 2048 + 524288 + 1048576 diff --git a/tests/test_cli.py b/tests/test_cli.py index 0af4b870d..d35a9db89 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -796,7 +796,7 @@ c.add_valid("--security label=foobar.label,a1,z2,b3") # --security static with c.add_invalid("--clock foo_tickpolicy=merge") # Unknown timer c.add_invalid("--security foobar") # Busted --security c.add_compare("--cpuset auto --vcpus 2", "cpuset-auto") # --cpuset=auto actually works -c.add_compare("--memory hotplugmemorymax=2048,hotplugmemoryslots=2 --cpu cell0.cpus=0,cell0.memory=1048576 --memdev dimm,access=private,target_size=512,target_node=0,source_pagesize=4,source_nodemask=1-2 --memdev nvdimm,source_path=/path/to/nvdimm,target_size=512,target_node=0,target_label_size=128,alias.name=mymemdev3", "memory-hotplug", precompare_check="5.3.0") +c.add_compare("--memory hotplugmemorymax=2048,hotplugmemoryslots=2 --cpu cell0.cpus=0,cell0.memory=1048576 --memdev dimm,access=private,target_size=512,target_node=0,source_pagesize=4,source_nodemask=1-2 --memdev nvdimm,source_path=/path/to/nvdimm,target_size=512,target_node=0,target_label_size=128,alias.name=mymemdev3,target.block=2048,target.requested=1048576,target.current=524288", "memory-hotplug", precompare_check="5.3.0") c.add_compare("--memory currentMemory=100,memory=200,maxmemory=300,maxMemory=400,maxMemory.slots=1", "memory-option-backcompat", precompare_check="5.3.0") c.add_compare("--connect " + utils.URIs.kvm_x86_q35 + " --cpu qemu64,secure=off", "cpu-disable-sec") # disable security features that are added by default c.add_compare("--cpu host-passthrough,migratable=on", "cpu-host-passthrough-migratable") # Passthrough with migratable attribute diff --git a/virtinst/cli.py b/virtinst/cli.py index 54acbac72..c5c170ef7 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -4235,6 +4235,9 @@ class ParserMemdev(VirtCLIParser): cls.add_arg("target.node", "target.node") cls.add_arg("target.label_size", "target.label_size", cb=cls.set_target_size) + cls.add_arg("target.block", "target.block") + cls.add_arg("target.current", "target.current") + cls.add_arg("target.requested", "target.requested") cls.add_arg("target.readonly", "target.readonly", is_onoff=True) cls.add_arg("source.pagesize", "source.pagesize") cls.add_arg("source.path", "source.path") diff --git a/virtinst/devices/memory.py b/virtinst/devices/memory.py index 177f5a5ca..812b4dbce 100644 --- a/virtinst/devices/memory.py +++ b/virtinst/devices/memory.py @@ -16,6 +16,9 @@ class _DeviceMemoryTarget(XMLBuilder): node = XMLProperty("./node", is_int=True) label_size = XMLProperty("./label/size", is_int=True) readonly = XMLProperty("./readonly", is_bool=True) + block = XMLProperty("./block", is_int=True) + requested = XMLProperty("./requested", is_int=True) + current = XMLProperty("./current", is_int=True) class _DeviceMemorySource(XMLBuilder):