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
父節點 4b0ce945b7
當前提交 6df309351d
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: 063938BA42CFA724

查看文件

@ -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')