details: Fix processor tab display for some LXC guests

With LXC domain, the 'current' attribute of 'vcpu' element is not
always present, but the code is still depending on it.
This commit is contained in:
Martin Kletzander 2013-10-21 11:39:16 +01:00
parent 2b7aa33887
commit 1ac755e7b2

View File

@ -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)