dom0/qvm-block: ignore devices with some field missing

This commit is contained in:
Marek Marczykowski 2012-03-30 00:19:15 +02:00
parent 749b84ec43
commit d8b979d844

View File

@ -219,6 +219,9 @@ def block_list(vm = None, system_disks = False):
device_desc = xs.read('', '/local/domain/%s/qubes-block-devices/%s/desc' % (xid, device))
device_mode = xs.read('', '/local/domain/%s/qubes-block-devices/%s/mode' % (xid, device))
if device_size is None or device_desc is None or device_mode is None:
print >> sys.stderr, "Missing field in %s device parameters" % device
continue
if not device_size.isdigit():
print >> sys.stderr, "Invalid %s device size in VM '%s'" % (device, vm_name)
continue