addhardware: Use virtmanager APIs for VM listing

This commit is contained in:
Cole Robinson 2014-09-20 13:04:47 -04:00
parent a3c6637989
commit 92f298e393
1 changed files with 2 additions and 3 deletions

View File

@ -1741,9 +1741,8 @@ class vmmAddHardware(vmmGObjectUI):
dev = virtinst.VirtualHostDevice(self.conn.get_backend())
# Hostdev collision
names = []
vms = self.conn.get_backend().fetch_all_guests()
for vm in vms:
for hostdev in vm.get_devices("hostdev"):
for vm in self.conn.list_vms():
for hostdev in vm.get_hostdev_devices():
if nodedev.compare_to_hostdev(hostdev):
names.append(vm.name)
if names: