virt-manager/7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
Charles Arnold 47dab25b0a - Upstream bug fixes (bsc#1027942)
b9bc3b60-undefine-only-persistent-domain.patch
  7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
  2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch

- bsc#1067263 - virt-install: ERROR unicode argument expected, got
  'str'
  f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
- Drop virtinst-fix-replace-StringIO-with-io.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=379
2017-11-28 16:06:53 +00:00

44 lines
1.5 KiB
Diff

Subject: addhardware: Fix virtio-scsi controller target calculation
From: Cole Robinson crobinso@redhat.com Wed Nov 22 14:58:12 2017 -0500
Date: Wed Nov 22 16:50:33 2017 -0500:
Git: 7fc7e94f211676b9a958662cb93edf770f23273c
More details here: https://www.redhat.com/archives/virt-tools-list/2017-November/msg00014.html
Reported-by: Lin Ma <lma@suse.com>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index cd82cd3..4a962e6 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -20,7 +20,6 @@
import logging
import traceback
-import collections
from gi.repository import Gtk
from gi.repository import Gdk
@@ -1455,13 +1454,18 @@ class vmmAddHardware(vmmGObjectUI):
if x.model == controller_model]
# Save occupied places per controller
- occupied = collections.defaultdict(int)
+ occupied = {}
for d in used_disks:
if d.get_target_prefix() == disk.get_target_prefix():
num = virtinst.VirtualDisk.target_to_num(d.target)
- occupied[num / 7] += 1
+ idx = num // 7
+ if idx not in occupied:
+ occupied[idx] = []
+ if d.target not in occupied[idx]:
+ occupied[idx].append(d.target)
+
for c in ctrls_scsi:
- if occupied[c.index] < 7:
+ if c.index not in occupied or len(occupied[c.index]) < 7:
controller = c
break
else: