usb: add usb_bus_release function
add global variables releasing logic when the usb buses were removed or hot-unpluged. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
f90e160b50
commit
e5a9bece9b
@ -87,6 +87,13 @@ void usb_bus_new(USBBus *bus, size_t bus_size,
|
||||
QTAILQ_INSERT_TAIL(&busses, bus, next);
|
||||
}
|
||||
|
||||
void usb_bus_release(USBBus *bus)
|
||||
{
|
||||
assert(next_usb_bus > 0);
|
||||
|
||||
QTAILQ_REMOVE(&busses, bus, next);
|
||||
}
|
||||
|
||||
USBBus *usb_bus_find(int busnr)
|
||||
{
|
||||
USBBus *bus;
|
||||
|
@ -529,6 +529,7 @@ struct USBBusOps {
|
||||
|
||||
void usb_bus_new(USBBus *bus, size_t bus_size,
|
||||
USBBusOps *ops, DeviceState *host);
|
||||
void usb_bus_release(USBBus *bus);
|
||||
USBBus *usb_bus_find(int busnr);
|
||||
void usb_legacy_register(const char *typename, const char *usbdevice_name,
|
||||
USBDevice *(*usbdevice_init)(USBBus *bus,
|
||||
|
Loading…
Reference in New Issue
Block a user