virt-manager/5319db07-customize-add-disk-fix.patch

29 lines
1.1 KiB
Diff
Raw Normal View History

Subject: addhardware: Fix adding disk through 'customize' dialog (bz 1073808)
From: Cole Robinson crobinso@redhat.com Fri Mar 7 09:37:08 2014 -0500
Date: Fri Mar 7 09:43:19 2014 -0500:
Git: 7ef9d7fbfc4173b6a6e88b6fb74e895293ffda55
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 75238d2..18f2aef 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1477,6 +1477,7 @@ 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))
@@ -1484,7 +1485,8 @@ class vmmAddHardware(vmmGObjectUI):
if d.target not in used:
used.append(d.target)
- prefer_ctrl = self._set_disk_controller(disk, controller_model, disks)
+ prefer_ctrl = self._set_disk_controller(
+ disk, controller_model, disks)
if not self.is_customize_dialog:
disk.generate_target(used, prefer_ctrl)