Blob Blame History Raw
From e5b3bc3b4c6e613e25988294ab3306b88deb061d Mon Sep 17 00:00:00 2001
From: Dan Kenigsberg <danken@redhat.com>
Date: Mon, 7 Oct 2013 01:46:54 +0100
Subject: [PATCH] vm.Vm._getUnderlyingDriveInfo: extract path of gluster disks

_getUnderlyingDriveInfo() is broken by design. It has no reliable means
to match Engine-requested devices with libvirt-produced ones. As a
heuristic, it uses the device's as matching key. However, before this
patch, it failed to extract the path from the xml definition of gluster
disks.

Bug-Url: https://bugzilla.redhat.com/1007980
Change-Id: I4459916cab24d735c067a6eb7020d4f43505fc97
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19906
Reviewed-by: Vinzenz Feenstra <vfeenstr@redhat.com>
Reviewed-by: Michal Skrivanek <michal.skrivanek@redhat.com>
Reviewed-by: Martin Polednik <mpoledni@redhat.com>
Tested-by: Martin Polednik <mpoledni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19950
---
 vdsm/vm.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vdsm/vm.py b/vdsm/vm.py
index f0690b7..662eacc 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -4579,7 +4579,8 @@ class Vm(object):
             sources = x.getElementsByTagName('source')
             if sources:
                 devPath = (sources[0].getAttribute('file') or
-                           sources[0].getAttribute('dev'))
+                           sources[0].getAttribute('dev') or
+                           sources[0].getAttribute('name'))
             else:
                 devPath = ''
 
-- 
1.8.3.1