On Thu, Dec 22, 2022 at 09:21:25PM +0800, Minglei Liu wrote: > ping ! > please review this patch : [PATCH] usbredir: Do not detach usb if backend > chardev disconnect - minglei.liu (kernel.org) > <https://lore.kernel.org/qemu-devel/20221109115619.696826-1-minglei....@smartx.com/> > > minglei.liu <minglei....@smartx.com> 于2022年11月9日周三 19:56写道: > > > If the network between qemu and usbredirserver is temporarily disconnected, > > the USB device in the VM will be unplugged. If the reconnect parameter is > > configured for the backend chardev, the device will be reconnected later. > > But from the inside of the VM, this USB device has experienced unplug and > > re-plug, if the USB storage device has been mounted in the VM before, > > the drive letter will change after the device is re-plugged. > > > > So in this case, we no longer unplug the device, and operations to the USB > > is returned immediately at this point.
If you are lucky, and it also depends on the kind of device. I don't think this is a safe thing to do in general. You just don't know what state the usb device is in when you are re-connecting, and you also don't know whenever a re-connect will ever happen. take care, Gerd