[virt-manager PATCH] details: Fix processor tab display for some LXC guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Notes:
    TBH, I haven;t gone through all the code to realize what _exactly_
    'self._startup_vcpus' means, but this is my best guess.

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

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux