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;
break;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
max = 31;
--
2.23.0