qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 3/4] usb-mtp: Add support for inotify based f


From: Bandan Das
Subject: Re: [Qemu-devel] [PATCH v3 3/4] usb-mtp: Add support for inotify based file monitoring
Date: Tue, 17 Nov 2015 18:48:11 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Gerd Hoffmann <address@hidden> writes:

>   Hi,
>
>> +#ifndef __linux__
>> +    return 1;
>> +#endif
>
> Hmm?  Shouldn't the stubs avoid these kinds of #ifdefs?
>
>> -    QLIST_FOREACH(iter, &o->children, list) {
>> +    QLIST_FOREACH_SAFE(iter, &o->children, list, next) {
>>          handles[i++] = iter->handle;
>>      }
>
> No need for SAFE here, you don't change the list.

Isn't the SAFE variant better for the case where a inotify delete event occurs
when we are getting the object handles ?

>> +        if (usb_mtp_inotify_init(s)) {
>> +            fprintf(stderr, "usb-mtp: file monitoring init failed\n");
>> +        }
>
> I guess we want a function/macro here for linux/non-linux, then report
> errors on linux only.  Reporting inotify failures on systems which don't
> support inotify in the first place is just noise ...

Agreed, I will rewrite this part.

> cheers,
>   Gerd



reply via email to

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