[virt-tools-list] [virt-manager PATCH v2] cli: Fix add --memballoon stats.period

Athina Plaskasoviti athina.plaskasoviti at gmail.com
Tue May 28 16:53:45 UTC 2019


XML Mapping

<memballoon model=...>
  <stats period="10"/>
</memballoon>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti at gmail.com>
---
 .../compare/virt-install-singleton-config-2.xml           | 8 ++++++--
 tests/clitest.py                                          | 2 +-
 virtinst/cli.py                                           | 1 +
 virtinst/devices/memballoon.py                            | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
index 7e320b91..cd22f5ae 100644
--- a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
+++ b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
@@ -187,7 +187,9 @@
       <model type="qxl"/>
     </video>
     <watchdog model="ib700" action="pause"/>
-    <memballoon model="virtio" autodeflate="on"/>
+    <memballoon model="virtio" autodeflate="on">
+      <stats period="10"/>
+    </memballoon>
     <rng model="virtio">
       <backend model="egd" type="udp">
         <source mode="bind" host="127.0.0.1" service="8000"/>
@@ -399,7 +401,9 @@
       <model type="qxl"/>
     </video>
     <watchdog model="ib700" action="pause"/>
-    <memballoon model="virtio" autodeflate="on"/>
+    <memballoon model="virtio" autodeflate="on">
+      <stats period="10"/>
+    </memballoon>
     <rng model="virtio">
       <backend model="egd" type="udp">
         <source mode="bind" host="127.0.0.1" service="8000"/>
diff --git a/tests/clitest.py b/tests/clitest.py
index 9a71c9d6..ceb1eebd 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -508,7 +508,7 @@ cache.mode=emulate,cache.level=3
 --controller scsi,model=virtio-scsi
 --graphics vnc
 --filesystem /foo/source,/bar/target
---memballoon virtio,autodeflate=on
+--memballoon virtio,autodeflate=on,stats.period=10
 --watchdog ib700,action=pause
 --tpm passthrough,model=tpm-crb,path=/dev/tpm0
 --rng egd,backend_host=127.0.0.1,backend_service=8000,backend_type=udp,backend_mode=bind,backend_connect_host=foo,backend_connect_service=708,rate.bytes=1234,rate.period=1000,model=virtio
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 715fc482..5accba8f 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3503,6 +3503,7 @@ class ParserMemballoon(VirtCLIParser):
 
         cls.add_arg("model", "model")
         cls.add_arg("autodeflate", "autodeflate", is_onoff=True)
+        cls.add_arg("stats.period", "stats_period")
 
 
 ###################
diff --git a/virtinst/devices/memballoon.py b/virtinst/devices/memballoon.py
index 1d990406..84467d22 100644
--- a/virtinst/devices/memballoon.py
+++ b/virtinst/devices/memballoon.py
@@ -14,6 +14,7 @@ class DeviceMemballoon(Device):
 
     model = XMLProperty("./@model")
     autodeflate = XMLProperty("./@autodeflate", is_onoff=True)
+    stats_period = XMLProperty("./stats/@period", is_int=True)
 
 
     ##################
-- 
2.20.1




More information about the virt-tools-list mailing list