Nir Soffer has uploaded a new change for review.
Change subject: vm: Avoid log spamming when drive format is undefined
......................................................................
vm: Avoid log spamming when drive format is undefined
Due to the dynamic way drive attribute are initialized, it is possible
that drive's format attribute is undefined. In this case _highwrite
fails repeatedly with noisy exception spamming vdsm log and syslog.
The purpose of _highwrite is to check if drive is too full and should be
extended before it is too late and the vm is paused. In this context, we
care only about block devices using 'cow' format. We could not care less
about drive without a format attribute, and there is no reason to spam
the log about this.
This patch use getattr to check if drive uses the cow format and make
the code more clear by extracting the check to new isExtendable method.
Change-Id: Ia50e8af94b9c9b54332066a3f30999ce73e7a56f
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/22551/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 1358b09..37b426a 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1406,6 +1406,10 @@
def isDiskReplicationInProgress(self):
return hasattr(self, "diskReplicate")
+ def isExtendable(self):
+ # Note: format may not be defined during migration
+ return self.blockDev and getattr(self, 'format', None) == 'cow'
+
@property
def volExtensionChunk(self):
"""
@@ -2312,7 +2316,7 @@
extend = []
for drive in self._devices[DISK_DEVICES]:
- if not drive.blockDev or drive.format != 'cow':
+ if not drive.isExtendable():
continue
capacity, alloc, physical = self._dom.blockInfo(drive.path, 0)
--
To view, visit
http://gerrit.ovirt.org/22551
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia50e8af94b9c9b54332066a3f30999ce73e7a56f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>