block: fix detection if the block device is attached anywhere

This commit is contained in:
Marek Marczykowski-Górecki 2015-07-13 00:58:11 +02:00
parent 4b0ce945b7
commit 6df309351d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -355,9 +355,8 @@ def block_check_attached(qvmc, device):
disks = parsed_xml.xpath("//domain/devices/disk")
for disk in disks:
backend_name = 'dom0'
# FIXME: move <domain/> into <source/>
if disk.find('domain') is not None:
backend_name = disk.find('domain').get('name')
if disk.find('backenddomain') is not None:
backend_name = disk.find('backenddomain').get('name')
source = disk.find('source')
if disk.get('type') == 'file':
path = source.get('file')