qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Bandan Das
Subject: Re: [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects
Date: Tue, 13 Feb 2018 14:35:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Gerd Hoffmann <address@hidden> 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);
>> +    g_free(o->path);
>> +    g_free(o);
>> +}
>> +#endif
>
> I'd suggest to move the #ifdef into the function, so it can be called
> unconditinally.  Also #else /* not needed with inotify because ... */
> would be nice.
>
>> +#ifndef CONFIG_INOTIFY1
>> +            usb_mtp_object_free_one(s, o);
>> +#endif
>
> These ifdefs can be dropped then.
>
>> +        /* Mark store as RW */
>> +        s->flags |= (1 << MTP_FLAG_WRITABLE);
>
> Do we want a property to enable write support?

Good idea, I will add one and set it to enabled by default.

Bandan

> cheers,
>   Gerd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]