mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
usb: hook unplug into qdev, cleanups + fixes.
Hook into DeviceInfo->exit(). handle_destroy() must not free the state struct, this is handled by the new usb_qdev_exit() function now. qdev_free(usb_device) works now. Fix usb hub to qdev_free() all connected devices on unplug. Unplugging a usb hub works now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
e3936fa574
commit
a8e662b547
8 changed files with 56 additions and 15 deletions
|
@ -512,9 +512,7 @@ static void usb_msd_handle_destroy(USBDevice *dev)
|
|||
{
|
||||
MSDState *s = (MSDState *)dev;
|
||||
|
||||
s->scsi_dev->info->destroy(s->scsi_dev);
|
||||
drive_uninit(s->dinfo->bdrv);
|
||||
qemu_free(s);
|
||||
}
|
||||
|
||||
static int usb_msd_initfn(USBDevice *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue