Re: [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects

2018-02-13 Thread Bandan Das
Gerd Hoffmann writes: >> +#ifndef CONFIG_INOTIFY1 >> +/* Assumes that children, if any, have been already freed */ >> +static void usb_mtp_object_free_one(MTPState *s, MTPObject *o) >> +{ >> +assert(o->nchildren == 0); >> +QTAILQ_REMOVE(&s->objects, o, next); >> +g_free(o->name); >> +

Re: [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects

2018-02-13 Thread Gerd Hoffmann
> +#ifndef CONFIG_INOTIFY1 > +/* Assumes that children, if any, have been already freed */ > +static void usb_mtp_object_free_one(MTPState *s, MTPObject *o) > +{ > +assert(o->nchildren == 0); > +QTAILQ_REMOVE(&s->objects, o, next); > +g_free(o->name); > +g_free(o->path); > +g_fr

[Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects

2018-02-12 Thread Bandan Das
Write of existing objects by the initiator is acheived by making a temporary buffer with the new changes, deleting the old file and then writing a new file with the same name. Advertise delete support and mark the store READ/WRITE since some initiators will fail the operation if the store is marked