libvirt-check-trim.py: handle no disks
This commit is contained in:
parent
78e606f6d7
commit
80df644701
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,10 @@ for domain in conn.listAllDomains():
|
|||
xml = domain.XMLDesc()
|
||||
tree = objectify.fromstring(xml)
|
||||
|
||||
if not hasattr(tree.devices, 'disk'):
|
||||
print('(has no disks)')
|
||||
continue
|
||||
|
||||
# every disk should be scsi + discard=unmap
|
||||
for disk in tree.devices.disk:
|
||||
if disk.get('device') != 'disk':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue