From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6aEd-0004eC-QT for qemu-devel@nongnu.org; Tue, 06 Aug 2013 01:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6aEY-0004wx-E8 for qemu-devel@nongnu.org; Tue, 06 Aug 2013 01:55:07 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:59258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6aEY-0004rc-5V for qemu-devel@nongnu.org; Tue, 06 Aug 2013 01:55:02 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq2so4289575pbb.5 for ; Mon, 05 Aug 2013 22:55:00 -0700 (PDT) Message-ID: <52008FAE.8060709@ozlabs.ru> Date: Tue, 06 Aug 2013 15:54:54 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1375323463-32747-1-git-send-email-afaerber@suse.de> <1375323463-32747-2-git-send-email-afaerber@suse.de> In-Reply-To: <1375323463-32747-2-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH for-next v2 01/22] object: Add OBJECT_GET_PARENT_CLASS() macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: qemu-devel@nongnu.org On 08/01/2013 12:17 PM, Andreas Färber wrote: > The object argument is currently unused and may be used to optimize the > class lookup when needed. > > Inspired-by: Peter Crosthwaite > Signed-off-by: Andreas Färber > --- > include/qom/object.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/qom/object.h b/include/qom/object.h > index 23fc048..a8e71dc 100644 > --- a/include/qom/object.h > +++ b/include/qom/object.h > @@ -511,6 +511,16 @@ struct TypeInfo > OBJECT_CLASS_CHECK(class, object_get_class(OBJECT(obj)), name) > > /** > + * OBJECT_GET_PARENT_CLASS: > + * @obj: The object to obtain the parent class for. > + * @name: The QOM typename of @obj. > + * > + * Returns the parent class for a given object of a specific class. > + */ > +#define OBJECT_GET_PARENT_CLASS(obj, name) \ > + object_class_get_parent(object_class_by_name(name)) > + > +/** > * InterfaceInfo: > * @type: The name of the interface. > * > Has anyone ever tried to use this macro? -- Alexey