qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/8] notifier: switch to QLIST


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/8] notifier: switch to QLIST
Date: Tue, 3 Jan 2012 12:09:37 +0000

On Tue, Jan 3, 2012 at 11:59 AM, Paolo Bonzini <address@hidden> wrote:
> On 01/03/2012 12:54 PM, Stefan Hajnoczi wrote:
>>
>> On Mon, Jan 02, 2012 at 07:00:30PM +0100, Paolo Bonzini wrote:
>>>
>>>  void notifier_list_add(NotifierList *list, Notifier *notifier)
>>>  {
>>> -    QTAILQ_INSERT_HEAD(&list->notifiers, notifier, node);
>>> +    QLIST_INSERT_HEAD(&list->notifiers, notifier, node);
>>>  }
>>>
>>> -void notifier_list_remove(NotifierList *list, Notifier *notifier)
>>> +void notifier_remove(Notifier *notifier)
>>
>>
>> Why introduce this asymmetry with notifier_list_add() and
>> notifier_remove()?  Please make the function names consistent.
>
>
> Because notifier_list_add adds the notifier to a specific NotifierList;
> notifier_remove removes the notifier from whatever list it is in.
>
> Normally whoever implements notifiers does not have access to the
> NotifierList, so there are wrappers for both notifier_list_add and
> notifier_list_remove.  This patch changes things so that the wrappers for
> notifier_remove are not needed anymore (though this series was already big
> enough, so I left the wrappers in).

I see.

Stefan



reply via email to

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