virt-manager/2eb455c9-correctly-calculate-virtio-scsi-controller-index.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.6 KiB
Diff

Subject: addhardware: Correctly calculate virtio-scsi controller index
From: Lin Ma lma@suse.com Mon Nov 6 20:52:07 2017 +0800
Date: Wed Nov 22 16:50:33 2017 -0500:
Git: 2eb455c97f1afda33a4b1c87adb2721fac9d9b5f
Because sata, usb and scsi use same device prefix: sd*, They will be
included into occupied list while we add virtio-scsi disks, This is
wrong and may cause adding additional virtio-scsi controller.
How to reproduce:
1. fresh install a qemu guest.
2. add 6 virtual USB disks.
3. add disk A on scsi bus.
(then a virtio-scsi controller 0 will be added automatically)
4. add disk B on scsi bus.
5. observe.
Expected:
disk A and disk B should be connected to virtio-scsi controller 0 because
controller 0 has enough available slots.
Actual:
disk A was connected to virtio-scsi controller 0.
An additional virtio-scsi controller 1 was added and disk B was connected
to it because virt-manager thought the virtio-scsi controller 0 doesn't
have available slot.
Signed-off-by: Lin Ma <lma@suse.com>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 4a962e6..e563fe6 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1456,7 +1456,8 @@ class vmmAddHardware(vmmGObjectUI):
# Save occupied places per controller
occupied = {}
for d in used_disks:
- if d.get_target_prefix() == disk.get_target_prefix():
+ if (d.get_target_prefix() == disk.get_target_prefix() and
+ d.bus == "scsi"):
num = virtinst.VirtualDisk.target_to_num(d.target)
idx = num // 7
if idx not in occupied: