From 3cbf948d39c50fe1f7675c08dc9fdc786dc57177 Mon Sep 17 00:00:00 2001 From: neingeist Date: Fri, 15 Jul 2016 18:09:19 +0200 Subject: [PATCH] libvirt-check-trim.py: check machine type of vm --- libvirt-check-trim.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libvirt-check-trim.py b/libvirt-check-trim.py index 885365c..30a868a 100644 --- a/libvirt-check-trim.py +++ b/libvirt-check-trim.py @@ -18,6 +18,12 @@ for domain in conn.listAllDomains(): xml = domain.XMLDesc() tree = objectify.fromstring(xml) + machine = tree.os.type.get('machine') + if machine < 'pc-i440fx-2.1': + print('machine should be at least pc-i440fx-2.1') + # Might want to check qemu-system-x86_64 -M help for supported + # machines. + if not hasattr(tree.devices, 'disk'): print('(has no disks)') continue