From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri329-0006ht-23 for qemu-devel@nongnu.org; Tue, 03 Jan 2012 07:00:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ri328-00072h-5b for qemu-devel@nongnu.org; Tue, 03 Jan 2012 07:00:01 -0500 Message-ID: <4F02EDBA.8090808@redhat.com> Date: Tue, 03 Jan 2012 12:59:54 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1325527237-24146-1-git-send-email-pbonzini@redhat.com> <1325527237-24146-2-git-send-email-pbonzini@redhat.com> <20120103115448.GB28826@stefanha-thinkpad.localdomain> In-Reply-To: <20120103115448.GB28826@stefanha-thinkpad.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/8] notifier: switch to QLIST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org 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). Paolo