[virt-tools-list] [PATCHv2 1/2] To support huge-sized page in virtinst

Cole Robinson crobinso at redhat.com
Thu Dec 22 18:40:44 UTC 2011


On 12/15/2011 01:13 AM, Li Zhang wrote:
> On some CPU architectures, huge-sized page are supported for
> performance boost. However, virt-manager doesn't support the
> feature of huge-sized page explicitly.
> 
> The patch is addressing the issue. Support of huge-sized page
> will be implemented in the Guest object so that the virt-manager
> can configure.
> 

Sorry for the review delay.

I squashed these two virtinst patches together, added you to AUTHORS, and
pushed. Thanks a bunch!

- Cole

> Signed-off-by: Li Zhang <zhlcindy at linux.vnet.ibm.com>
> ---
>  virtinst/Guest.py |   16 +++++++++++++++-
>  1 files changed, 15 insertions(+), 1 deletions(-)
> 
> diff --git a/virtinst/Guest.py b/virtinst/Guest.py
> index 46ec340..a5d2e56 100644
> --- a/virtinst/Guest.py
> +++ b/virtinst/Guest.py
> @@ -190,6 +190,7 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
>          self._uuid = None
>          self._memory = None
>          self._maxmemory = None
> +        self._hugepage = None
>          self._vcpus = 1
>          self._maxvcpus = 1
>          self._cpuset = None
> @@ -343,6 +344,14 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
>                                xpath="./memory",
>                                get_converter=lambda s, x: int(x) / 1024,
>                                set_converter=lambda s, x: int(x) * 1024)
> +    def get_hugepage(self):
> +        return self._hugepage
> +    def set_hugepage(self, val):
> +        if val is None:
> +            return val
> +        self._hugepage = bool(val)
> +    hugepage = _xml_property(get_hugepage, set_hugepage,
> +                             xpath="./memoryBacking/hugepages", is_bool=True)
>  
>      # UUID for the guest
>      def get_uuid(self):
> @@ -1044,9 +1053,14 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
>          xml = add(desc_xml)
>          xml = add("  <memory>%s</memory>" % (self.maxmemory * 1024))
>          xml = add("  <currentMemory>%s</currentMemory>" % (self.memory * 1024))
> +
>          # <blkiotune>
>          # <memtune>
> -        # <memoryBacking>
> +        if self.hugepage is True:
> +            xml = add("  <memoryBacking>")
> +            xml = add("    <hugepages/>")
> +            xml = add("  </memoryBacking>")
> +
>          xml = add(self._get_vcpu_xml())
>          # <cputune>
>          xml = add(self.numatune.get_xml_config())




More information about the virt-tools-list mailing list