> -Original Message-
> From: Gerd Hoffmann [mailto:kra...@redhat.com]
> Sent: Monday, June 02, 2014 3:36 PM
> To: Gonglei (Arei)
> Cc: qemu-devel@nongnu.org; Luonengjun; Huangweidong (C); Huangpeng
> (Peter)
> Subject: Re: [PATCH 1/6] usb: add usb_bus_release function
>
> Hi,
>
> > +voi
Hi,
> +void usb_bus_release(USBBus *bus)
> +{
> +assert(next_usb_bus > 0);
> +
> +next_usb_bus--;
> +QTAILQ_REMOVE(&busses, bus, next);
> +}
That breaks when not hotplugging in last-in-first-out order. I'd
suggest to simply leave next_usb_bus alone on unplug. It is only used
for b
From: Gonglei
add global variables releasing logic when the usb buses
were removed or hot-unpluged.
Signed-off-by: Gonglei
---
hw/usb/bus.c | 8
include/hw/usb.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 927a47b..e65f272 100644
--- a/h