virt-manager/Attempt-empty-path-on-virDomainBlockStats.patch

46 lines
1.5 KiB
Diff
Raw Normal View History

From 561e7318d19adaba9ea79f6f3010bc1fe9d37d10 Mon Sep 17 00:00:00 2001
From: Thorsten Behrens <tbehrens@suse.com>
Date: Sun, 12 Jan 2014 03:13:54 +0100
Subject: [PATCH 3/3] Attempt empty path on virDomainBlockStats
libvirt for some backends yields summary domain stats for empty
disk path.
Conflicts:
virtManager/domain.py
---
virtManager/domain.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: virt-manager-0.10.0/virtManager/domain.py
===================================================================
--- virt-manager-0.10.0.orig/virtManager/domain.py
+++ virt-manager-0.10.0/virtManager/domain.py
@@ -196,6 +196,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()
@@ -1705,6 +1706,18 @@ class vmmDomain(vmmLibvirtObject):
not self.is_active()):
return rd, wr
+ # attempt to retrieve summary stats for domain
+ 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_necc=False):
dev = disk.target
if not dev: