addhardware: Generate disk targets for disks via customize dialog

Since the XML we use now is with the defaults filled in. Fixes some
issues in the log here:

https://bugzilla.redhat.com/show_bug.cgi?id=1213475
This commit is contained in:
Cole Robinson 2015-05-03 17:17:53 -04:00
parent a8d3afbcd9
commit 4547031152

View File

@ -1683,20 +1683,16 @@ class vmmAddHardware(vmmGObjectUI):
disk.driver_cache = cache
# Generate target
disks = []
if not self.is_customize_dialog:
disks = (self.vm.get_disk_devices() +
self.vm.get_disk_devices(inactive=True))
for d in disks:
if d.target not in used:
used.append(d.target)
disks = (self.vm.get_disk_devices() +
self.vm.get_disk_devices(inactive=True))
for d in disks:
if d.target not in used:
used.append(d.target)
prefer_ctrl = self._set_disk_controller(
disk, controller_model, disks)
if not self.is_customize_dialog:
disk.generate_target(used, prefer_ctrl)
disk.generate_target(used, prefer_ctrl)
except Exception, e:
return self.err.val_err(_("Storage parameter error."), e)