On Mi, 2014-09-24 at 11:48 +0000, Igor Mammedov wrote: > usb-storage uses SCSI bus to provide underling storage > (i.e. scsi-disk) and it's hotpluggable.
No. usb-storage itself (the scsi hba) is hotpluggable, but the scsi devices connected are not. On the qemu side it isn't a problem, but the protocol has constrains. First there is no way to signal devices coming and going, so the guest wouldn't see them until reboot (or manual driver reload). Second for multi-lun devices only the number of luns is reported and devices are expected to have luns 0 .. $count-1. So with three devices connected and the second being hot-unplugged you end up with an illegal configuration. Therefore device initialization (IIRC) goes like this today: (1) add hba (i.e. usb-storage). (2) add scsi device. (3) turn off hotplug on the scsi bus. (4) make the whole thing visible to the guest (usb_attach_device). cheers, Gerd