virt-manager/530c021c-attempt-empty-path-on-virDomainBlockStats.patch
Charles Arnold 674941bbf7 - Upstream bug fixes
53022930-lxc-connection-fix.patch
  530229cb-non-x86-kvm-creation-fix.patch
  53023f56-dont-alter-caps-machine-list-on-create.patch
  53030858-generate_target-fix.patch
  53037798-not-customizing-generate_target-fix.patch
  53047532-dont-get-duplicated-disks.patch
  53047595-calculate-disk-bus-properly.patch
  530987c4-disk-bus-calculation-fix.patch
  530c021c-attempt-empty-path-on-virDomainBlockStats.patch
  530cd6ab-log-broken-xml.patch
  530cf4de-allow-numbered-object-names.patch
  530cfa5e-close-connection-on-tick-failure-fix.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=146
2014-02-28 14:58:33 +00:00

40 lines
1.5 KiB
Diff

Subject: Attempt empty path on virDomainBlockStats
From: Thorsten Behrens tbehrens@suse.com Fri Feb 21 11:38:41 2014 +0100
Date: Mon Feb 24 21:38:20 2014 -0500:
Git: b5c3fe1da5f67e0a83a3bc5c9358cbc779157354
libvirt for some backends yields summary domain stats for empty
disk path - which saves us the looping on our side.
Index: virt-manager-1.0.0/virtManager/domain.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/domain.py
+++ virt-manager-1.0.0/virtManager/domain.py
@@ -270,6 +270,7 @@ class vmmDomain(vmmLibvirtObject):
self._enable_disk_poll = False
self._stats_disk_supported = True
self._stats_disk_skip = []
+ self._summary_disk_stats_skip = False
self.inspection = vmmInspectionData()
@@ -1769,6 +1770,18 @@ class vmmDomain(vmmLibvirtObject):
self._stats_disk_skip = []
return rd, wr
+ # Some drivers support this method for getting all usage at once
+ if not self._summary_disk_stats_skip:
+ try:
+ io = self._backend.blockStats('')
+ if io:
+ rd = io[1]
+ wr = io[3]
+ return rd, wr
+ except libvirt.libvirtError:
+ self._summary_disk_stats_skip = True
+
+ # did not work, iterate over all disks
for disk in self.get_disk_devices(refresh_if_nec=False):
dev = disk.target
if not dev: