Bug 1369311 - Scsi-hd device have no free target when add it's command after the usb-storage device's
Summary: Scsi-hd device have no free target when add it's command after the usb-storag...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-23 06:13 UTC by Xujun Ma
Modified: 2019-01-15 10:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-09 15:11:12 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Xujun Ma 2016-08-23 06:13:50 UTC
Description of problem:
Scsi-hd device have no free target when add it's cmdline after the usb-storage device's

Version-Release number of selected component (if applicable):
qemu-img-rhev-2.6.0-22.el7.ppc64le

How reproducible:
100%

Steps to Reproduce:
1.Boot vm with command:
/usr/libexec/qemu-kvm \
 -name vm \
 -smp 4 \
 -m 8192 \
 -monitor stdio \
 -vnc 0:59 \
 -qmp tcp:0:9999,server,nowait \
 -device virtio-scsi-pci,bus=pci.0\
 -device nec-usb-xhci,id=controller \
 -device usb-tablet,id=usbtablet \
 -drive file=data.qcow2,if=none,id=driveusb,media=disk,format=qcow2,cache=none \
 -device usb-storage,drive=driveusb,id=usbdisk,bus=controller.0,removable=on \
 -device scsi-hd,id=scsi-hd0,drive=scsi-hd-dr0,bootindex=0 \
 -drive file=/home/RHEL-Server-7.3-ppc64le-virtio.qcow2,if=none,id=scsi-hd-dr0,format=qcow2,cache=none \
2.
3.

Actual results:
Booting vm failed with error as following:
(qemu) qemu-kvm: -device scsi-hd,id=scsi-hd0,drive=scsi-hd-dr0,bootindex=0: no free target

Expected results:
Booting vm succeed without any error

Additional info:
x86 has this issue too.

Comment 2 Gerd Hoffmann 2017-01-09 15:11:12 UTC
(In reply to Xujun Ma from comment #0)
> Description of problem:
> Scsi-hd device have no free target when add it's cmdline after the
> usb-storage device's

usb-storage is a scsi host adapter too, so you now have two of them in the system.  Which in turn implies that you have to explicitly tell qemu which adapter you want attach your scsi devices to.

>  -device virtio-scsi-pci,bus=pci.0\

Use "id=${name}" to attach a name to the controller.

>  -device scsi-hd,id=scsi-hd0,drive=scsi-hd-dr0,bootindex=0 \

Use "bus=${name}.0" to tell which host controller should be used.


Note You need to log in before you can comment on or make changes to this bug.