Re: [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children

2015-11-05 Thread Bandan Das
Gerd Hoffmann writes: >> static void usb_mtp_object_free(MTPState *s, MTPObject *o) >> { >> -int i; >> +MTPObject *iter; >> + >> +if (o) { >> +trace_usb_mtp_object_free(s->dev.addr, o->handle, o->path); > > That also makes usb_mtp_object_free callable with o == NULL. Makes

Re: [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children

2015-11-05 Thread Gerd Hoffmann
> static void usb_mtp_object_free(MTPState *s, MTPObject *o) > { > -int i; > +MTPObject *iter; > + > +if (o) { > +trace_usb_mtp_object_free(s->dev.addr, o->handle, o->path); That also makes usb_mtp_object_free callable with o == NULL. Makes sense, but also makes this patch h

[Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children

2015-11-03 Thread Bandan Das
To support adding/removal of objects, we will need to update the object cache hierarchy we have built internally. Convert to using a Qlist for easier management. Signed-off-by: Bandan Das --- hw/usb/dev-mtp.c | 67 +--- trace-events | 1 +