domain: Don't fetch XML on tick to get vcpu count

It's available in the domain info structure. Saves us from hammering
xenstored and just plain doing to much work on every tick.
This commit is contained in:
Cole Robinson 2011-08-23 15:47:31 -04:00
parent a815fa17a7
commit 9dc799af9c

View File

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