Change in vdsm[master]: vdsm: add logging to _getUnderlyingDriveInfo

mpoledni at redhat.com mpoledni at redhat.com
Mon Oct 7 12:24:50 UTC 2013


Martin Polednik has uploaded a new change for review.

Change subject: vdsm: add logging to _getUnderlyingDriveInfo
......................................................................

vdsm: add logging to _getUnderlyingDriveInfo

_getUnderlyingDriveInfo() currently logs nothing - due
to unfrequent calls to this function, it might be good idea
to add verbose logging that displays how the devices are
matched in _devices and conf['devices']

Change-Id: I884e6b25c5bcb71ee24ad9ebad8df7c2775c5e19
Signed-off-by: Martin Polednik <mpoledni at redhat.com>
---
M vdsm/vm.py
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/28/19928/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index f09b739..1926631 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -4667,8 +4667,15 @@
             # Get disk address
             address = self._getUnderlyingDeviceAddress(x)
 
+            # Keep data as dict for easier debugging
+            deviceDict = {'path': devPath, 'target': target, 'name': name,
+                          'readonly': readonly, 'bootOrder': bootOrder,
+                          'address': address, 'type': devType, 'boot': boot}
+
+            self.log.debug('Found drive with attributes %s', deviceDict)
             for d in self._devices[DISK_DEVICES]:
                 if d.path == devPath:
+                    self.log.debug('Matched %s with %s', deviceDict, d)
                     d.name = name
                     d.type = devType
                     d.drv = drv
@@ -4681,6 +4688,7 @@
             knownDev = False
             for dev in self.conf['devices']:
                 if dev['type'] == DISK_DEVICES and dev['path'] == devPath:
+                    self.log.debug('Matched %s with %s', deviceDict, dev)
                     dev['name'] = name
                     dev['address'] = address
                     dev['alias'] = alias
@@ -4697,6 +4705,7 @@
                            'readonly': str(readonly)}
                 if bootOrder:
                     diskDev['bootOrder'] = bootOrder
+                self.log.debug('Found unknown drive: %s', diskDev)
                 self.conf['devices'].append(diskDev)
 
     def _getUnderlyingDisplayPort(self):


-- 
To view, visit http://gerrit.ovirt.org/19928
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I884e6b25c5bcb71ee24ad9ebad8df7c2775c5e19
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni at redhat.com>


More information about the vdsm-patches mailing list