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:
Gerd Hoffmann 2009-09-25 21:42:39 +02:00 committed by Anthony Liguori
parent e3936fa574
commit a8e662b547
8 changed files with 56 additions and 15 deletions

View file

@ -614,7 +614,6 @@ static void usb_bt_handle_destroy(USBDevice *dev)
s->hci->opaque = NULL;
s->hci->evt_recv = NULL;
s->hci->acl_recv = NULL;
qemu_free(s);
}
static int usb_bt_initfn(USBDevice *dev)