File virtman-git-vcpu-count.diff of Package virt-manager
Subject: domain: Don't fetch XML on tick to get vcpu count
From: Cole Robinson crobinso@redhat.com Tue Aug 23 15:47:31 2011 -0400
Date: Tue Aug 23 15:48:30 2011 -0400:
Git: 9dc799af9c3d4fab926ee41685d68642c95593fe
It's available in the domain info structure. Saves us from hammering
xenstored and just plain doing to much work on every tick.
Index: virt-manager-0.9.0/src/virtManager/domain.py
===================================================================
--- virt-manager-0.9.0.orig/src/virtManager/domain.py
+++ virt-manager-0.9.0/src/virtManager/domain.py
@@ -1152,10 +1152,10 @@ class vmmDomain(vmmLibvirtObject):
if not (info[0] in [libvirt.VIR_DOMAIN_SHUTOFF,
libvirt.VIR_DOMAIN_CRASHED]):
+ guestcpus = info[3]
cpuTime = info[4] - prevCpuTime
cpuTimeAbs = info[4]
hostcpus = self.conn.host_active_processor_count()
- guestcpus = self.vcpu_count()
pcentbase = (((cpuTime) * 100.0) /
((now - prevTimestamp) * 1000.0 * 1000.0 * 1000.0))