From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6chf-0007Zz-4Z for qemu-devel@nongnu.org; Tue, 06 Aug 2013 04:33:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6chY-0005Qt-TN for qemu-devel@nongnu.org; Tue, 06 Aug 2013 04:33:15 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59333 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6chY-0005QQ-O1 for qemu-devel@nongnu.org; Tue, 06 Aug 2013 04:33:08 -0400 Message-ID: <5200B4C1.9010008@suse.de> Date: Tue, 06 Aug 2013 10:33:05 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1375323463-32747-1-git-send-email-afaerber@suse.de> <1375323463-32747-2-git-send-email-afaerber@suse.de> <52008FAE.8060709@ozlabs.ru> In-Reply-To: <52008FAE.8060709@ozlabs.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Alexey Kardashevskiy Cc: Peter Crosthwaite , qemu-devel@nongnu.org, Anthony Liguori Am 06.08.2013 07:54, schrieb Alexey Kardashevskiy: > On 08/01/2013 12:17 PM, Andreas F=C3=A4rber wrote: >> The object argument is currently unused and may be used to optimize th= e >> class lookup when needed. >> >> Inspired-by: Peter Crosthwaite >> Signed-off-by: Andreas F=C3=A4rber >> --- >> 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) >> =20 >> /** >> + * 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. >> * >> >=20 > Has anyone ever tried to use this macro? Since you're asking me, obviously later in this virtio series it's used and in the IndustryPack series as well. I'm not aware of anyone else having used it yet - I'm still waiting for review feedback from Peter Cr. and/or Anthony (or you!) before I put it on qom-next. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg