cli: Add special treatment for --memballoon none

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@redhat.com>
This commit is contained in:
Andrea Bolognani 2019-06-13 12:55:09 +02:00 committed by Cole Robinson
parent 72fc6781c8
commit fb81adea7e
2 changed files with 7 additions and 0 deletions

View File

@ -3576,6 +3576,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 #

View File

@ -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.skip_default_osinfo = False