From cebc24b670592d6ed97080a094944d07d51a287e Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 30 Mar 2012 00:19:15 +0200 Subject: [PATCH] dom0/qvm-block: ignore devices with some field missing --- dom0/qvm-core/qubesutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom0/qvm-core/qubesutils.py b/dom0/qvm-core/qubesutils.py index f31a35d5..f3cdb79b 100644 --- a/dom0/qvm-core/qubesutils.py +++ b/dom0/qvm-core/qubesutils.py @@ -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