From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NpjmP-0008EH-Sl for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:54:29 -0500 Received: from [199.232.76.173] (port=59202 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NpjmP-0008DZ-8j for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:54:29 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NpjmN-0008KM-Bv for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:54:28 -0500 Received: from qw-out-1920.google.com ([74.125.92.149]:24055) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NpjmN-0008K8-1d for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:54:27 -0500 Received: by qw-out-1920.google.com with SMTP id 5so28181qwf.4 for ; Thu, 11 Mar 2010 06:54:26 -0800 (PST) Message-ID: <4B99041F.7030800@codemonkey.ws> Date: Thu, 11 Mar 2010 08:54:23 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists References: <1268239869-16058-1-git-send-email-aliguori@us.ibm.com> <201003111257.59828.paul@codesourcery.com> <4B98F99F.1000506@codemonkey.ws> <201003111419.53494.paul@codesourcery.com> In-Reply-To: <201003111419.53494.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Anthony Liguori , Luiz Capitulino , qemu-devel@nongnu.org, Gerd Hoffman On 03/11/2010 08:19 AM, Paul Brook wrote: >> On 03/11/2010 06:57 AM, Paul Brook wrote: >> >>>> +struct QEMUNotifier >>>> +{ >>>> + void (*notify)(QEMUNotifier *notifier); >>>> +}; >>>> >>> I suggest combining this with QEMUBH. >>> >> I take it your not opposed to converting QEMUBH to be a QEMUNotifier? >> If so, I'm happy to do it. >> > It's unclear to me why you've invented a new thing in the first place. > This style of callback has a number of advantages: - It provides better type safety since - It's a more compact representation - It maps to a function object (functor) which is a pretty common pattern in most high level languages Regards, Anthony Liguori > Paul >