[virt-tools-list] [virt-manager PATCH] cli: Add --memballoon autodeflate

Cole Robinson crobinso at redhat.com
Thu May 23 14:10:02 UTC 2019


On 5/23/19 8:57 AM, Athina Plaskasoviti wrote:
> XML Mapping:
> 
> <memballoon model=...>
>   <autodeflate>on</autodeflate>
> </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                                           | 2 +-
>  virtinst/devices/memballoon.py                            | 2 +-
>  4 files changed, 9 insertions(+), 5 deletions(-)
> 

Comments below

> 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 839098f4..8f04436a 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"/>
> +    <memballoon model="virtio">
> +      <autodeflate>on</autodeflate>
> +    </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"/>
> +    <memballoon model="virtio">
> +      <autodeflate>on</autodeflate>
> +    </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 84d6ec90..9a71c9d6 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
> +--memballoon virtio,autodeflate=on
>  --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 5356e7b4..8270ef32 100644
> --- a/virtinst/cli.py
> +++ b/virtinst/cli.py
> @@ -3501,7 +3501,7 @@ class ParserMemballoon(VirtCLIParser):
>          _add_common_device_args(cls, virtio_options=True)
>  
>          cls.add_arg("model", "model")
> -
> +        cls.add_arg("autodeflate", "autodeflate", is_onoff=True)
>  
>  ###################
>  # --panic parsing #
> diff --git a/virtinst/devices/memballoon.py b/virtinst/devices/memballoon.py
> index 5c3404b0..0e73c2c3 100644
> --- a/virtinst/devices/memballoon.py
> +++ b/virtinst/devices/memballoon.py
> @@ -13,7 +13,7 @@ class DeviceMemballoon(Device):
>      XML_NAME = "memballoon"
>  
>      model = XMLProperty("./@model")
> -
> +    autodeflate = XMLProperty("./autodeflate", is_onoff=True)
>

Here and patch chunk above you delete an empty line. Please preserve
newlines/whitespace when making changes. The patch looks good otherwise
so I fixed those and pushed it

Thanks,
Cole




More information about the virt-tools-list mailing list