[virt-tools-list] [virt-manager PATCH] details: Fix processor tab display for some LXC guests
Cole Robinson
crobinso at redhat.com
Mon Oct 28 16:11:24 UTC 2013
On 10/21/2013 10:56 AM, Martin Kletzander wrote:
> With LXC domain, the 'current' attribute of 'vcpu' element is not
> always present, but the code is still depending on it.
>
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
>
> Notes:
> TBH, I haven;t gone through all the code to realize what _exactly_
> 'self._startup_vcpus' means, but this is my best guess.
>
startup_vcpus was for handling back compat with old libvirt versions that
didn't have a concept of max vcpus vs. current vcpus, so we use 'vcpus at
guest startup' to mean 'maxvcpus'.
> virtManager/domain.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/virtManager/domain.py b/virtManager/domain.py
> index 4ff156e..d099176 100644
> --- a/virtManager/domain.py
> +++ b/virtManager/domain.py
> @@ -1036,7 +1036,10 @@ class vmmDomain(vmmLibvirtObject):
> return int(self.get_xmlobj().maxmemory)
>
> def vcpu_count(self):
> - return int(self.get_xmlobj().curvcpus)
> + guest = self.get_xmlobj()
> + return int(guest.curvcpus or
> + self._startup_vcpus or
> + guest.vcpus)
> def vcpu_max_count(self):
> guest = self.get_xmlobj()
> has_xml_max = (guest.curvcpus != guest.vcpus)
>
ACK
Thanks,
Cole
More information about the virt-tools-list
mailing list