On 09/03/2013 08:06 AM, Gerd Hoffmann wrote: > Hi, > >>>> How does this work if we start off a guest with 3 disks >>>> attached to the usb-bot SCSI controller. Then hot-unplug >>>> the 2nd disk. >>> You can't hotplug individual luns anyway. >> How does hotplug/unplug work in the context of usb-bot ? >> >> AFAIK we need to be able to run >> >> device_add usb_bot >> drive_add file... >> device_add scsi-hd >> >> And the reverse, to unplug it, if we're to have feature parity with >> usb-storage. > Hot-unplug is easy. You can remove the usb-bot device which will also > remove all child devices. > > Hot-plug doesn't work at the moment, and I don't see any obvious way to > fix that properly :-( > > We need some way to hotplug a *group* of devices (usb-bot + all > children) as usb-bot itself is hotpluggable but the individual scsi > devices connected to it are not. There is another case where hot-plug/unplug of a group of devices would be useful - if you want to hotplug/unplug a pci passthrough device using vfio *and* that device is a part of an iommu group that contains other devices *and* you're okay with having those other devices assigned to the guest as well *AND* you want to use "managed='yes'" (where libvirt automatically unbinds the devices from the host driver and binds them to vfio-pci before passing them off to the guest), then you need to be able to plug and unplug all the devices in that iommu group in a single operation, otherwise the plug fails (due to attempting to assign one device in a group when the other devices haven't been bound to vfio-pci or pci-stub). As it stands now you can only hot-plug/unplug with vfio if a device is in an iommu group all by itself, or if you don't use managed='yes', and instead deal with binding the devices to vfio-pci manually. If none of that makes sense, consider yourself lucky :-) > > I could allow hotplug on usb-bot as workaround, then you can do > > stop > device_add usb_bot > device_add scsi-{hd,cd,whatever} > cont > > but that would be more a gross hack than a solution ... > > cheers, > Gerd > > > > -- > libvir-list mailing list > libvir-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/libvir-list > -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list