On Mon, Dec 2, 2019 at 4:17 PM Boris Fiuczynski <fiuczy(a)linux.ibm.com>
wrote:
On 11/29/19 11:18 AM, Han Han wrote:
> In qemu, 16383 is the top valid value for virtio scsi unit number:
>
> $ /usr/libexec/qemu-kvm \
> -device \
> virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 \
> -drive \
> file=A.qcow2,format=qcow2,if=none,id=drive
> -device \
> scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=16383,drive=drive,id=disk
> VNC server running on ::1:5900
>
> $ /usr/libexec/qemu-kvm \
> -device \
> virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 \
> -drive \
> file=A.qcow2,format=qcow2,if=none,id=drive
> -device \
> scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=16384,drive=drive,id=disk
> qemu-kvm: ...: bad scsi device lun: 16384
>
> So adjust libvirt to use the virtio scsi unit valid range 0..16383.
>
> Signed-off-by: Han Han <hhan(a)redhat.com>
> ---
> src/conf/domain_conf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 95808847..d315b431 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -4823,7 +4823,7 @@ virDomainSCSIDriveAddressIsUsed(const virDomainDef
*def,
> case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
> case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL:
> case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
> - max = 16383;
> + max = 16384;
Instead of increasing max shouldn't the check for max introduced by
commit c8007fdc5d2 be changed from addr->unit >= max into addr->unit > max
?
Considering the 'max' of other scsi controllers, I think you are right. I
will update it then
> break;
> case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
> max = 31;
>
--
Mit freundlichen Grüßen/Kind regards
Boris Fiuczynski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
--
Best regards,
-----------------------------------
Han Han
Quality Engineer
Redhat.
Email: hhan(a)redhat.com
Phone: +861065339333