Change in vdsm[master]: hotunplug: supporting lun and cinder disks fix.

aaviram at redhat.com aaviram at redhat.com
Tue Oct 27 18:25:13 UTC 2015


Amit Aviram has uploaded a new change for review.

Change subject: hotunplug: supporting lun and cinder disks fix.
......................................................................

hotunplug: supporting lun and cinder disks fix.

While hotunplugging, VDSM queries libvirt for the unplugged disk to
verify it was removed. This check is in _isDriveAttached, which verifies
that the disk's serial is no longer among the VM's disks. As LUN disks
and Cinder disks currently do not have a serial specified in VDSM flows,
_isDriveAttached was faulted.

This patch fixes _isDriveAttached to check the disk's presence by
verifying the disk's path no longer exists in the xml, rather than the
serial- to make it support LUN and Cinder disks.

Change-Id: I826eba42903167988da1d02b916feb8fcd19258e
Bug-Url: https://bugzilla.redhat.com/1270834
Signed-off-by: Amit Aviram <aaviram at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/47795/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 14b0a94..95975cf 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2700,7 +2700,10 @@
 
     def _isDriveAttached(self, drive):
         root = ET.fromstring(self._dom.XMLDesc(0))
-        return bool(root.findall("./devices/disk[serial='%s']" % drive.serial))
+        sourceDict = {'file':'file', 'block':'dev', 'network':'name'}
+        return bool(root.findall("./devices/disk/source[@%s='%s']" %
+                                 (sourceDict[drive.diskType], drive.path)))
+
 
     def _readPauseCode(self):
         state, reason = self._dom.state(0)


-- 
To view, visit https://gerrit.ovirt.org/47795
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I826eba42903167988da1d02b916feb8fcd19258e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>


More information about the vdsm-patches mailing list