[virt-manager PATCH 3/4] cli: Add special treatment for --memballoon none

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We want to start adding a memory balloon automatically to
guests, but we also need to make sure that it can be explicitly
disabled at the user's request.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 virtinst/cli.py   | 6 ++++++
 virtinst/guest.py | 1 +
 2 files changed, 7 insertions(+)

diff --git a/virtinst/cli.py b/virtinst/cli.py
index 4b985097..f4053daf 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3557,6 +3557,12 @@ class ParserMemballoon(VirtCLIParser):
         cls.add_arg("autodeflate", "autodeflate", is_onoff=True)
         cls.add_arg("stats.period", "stats_period")
 
+    def _parse(self, inst):
+        if self.optstr == "none":
+            self.guest.disable_default_memballoon = True
+
+        return super()._parse(inst)
+
 
 ###################
 # --panic parsing #
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 717ed21e..e1162ff7 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -227,6 +227,7 @@ class Guest(XMLBuilder):
         self.skip_default_usbredir = False
         self.skip_default_graphics = False
         self.skip_default_rng = False
+        self.disable_default_memballoon = False
         self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
 
         self.__osinfo = None
-- 
2.21.0

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux