From d620a51082ca359835a034cb93ad9a7fd6c760b5 Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 29 Dec 2016 14:27:35 +0100 Subject: [PATCH] libvirt-check-trim: commit two remaining code chunks --- libvirt-check-trim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvirt-check-trim b/libvirt-check-trim index ff10883..9aeed52 100755 --- a/libvirt-check-trim +++ b/libvirt-check-trim @@ -26,6 +26,7 @@ for domain in conn.listAllDomains(): xml = domain.XMLDesc() tree = objectify.fromstring(xml) + # machine type version should be >= 2.1 if i440fx machine = tree.os.type.get('machine') matches = re.match('^pc-(?:i440fx-)?([0-9.]*)', machine) if matches: @@ -35,6 +36,7 @@ for domain in conn.listAllDomains(): # Might want to check "qemu-system-x86_64 -M help" for supported # machines. + # no disks, no need to check if not hasattr(tree.devices, 'disk'): print('(has no disks)') continue