From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNg5Q-0006cN-Tw for qemu-devel@nongnu.org; Thu, 04 Apr 2013 05:04:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNg5M-00071S-Ab for qemu-devel@nongnu.org; Thu, 04 Apr 2013 05:04:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56698 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNg5M-00071J-1V for qemu-devel@nongnu.org; Thu, 04 Apr 2013 05:03:56 -0400 Message-ID: <515D41F9.8050107@suse.de> Date: Thu, 04 Apr 2013 11:03:53 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1363876125-8264-1-git-send-email-imammedo@redhat.com> <1363876125-8264-7-git-send-email-imammedo@redhat.com> In-Reply-To: <1363876125-8264-7-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 06/12] target-i386: replace FROM_SYSBUS() with QOM type cast List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, stefano.stabellini@eu.citrix.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, armbru@redhat.com, blauwirbel@gmail.com, quintela@redhat.com, alex.williamson@redhat.com, kraxel@redhat.com, anthony.perard@citrix.com, yang.z.zhang@intel.com, pbonzini@redhat.com, lcapitulino@redhat.com, rth@twiddle.net Am 21.03.2013 15:28, schrieb Igor Mammedov: > ... and define type name and type cast macro for kvmvapic according > to accepted convention. >=20 > Signed-off-by: Igor Mammedov This looks great and a cherry-pick candidate if you agree? Just wondering, was there a name conflict for shorter VAPIC()? It's file-local, so doesn't really matter. Andreas > --- > hw/i386/kvmvapic.c | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c > index c151c95..21551a5 100644 > --- a/hw/i386/kvmvapic.c > +++ b/hw/i386/kvmvapic.c > @@ -62,6 +62,9 @@ typedef struct VAPICROMState { > bool rom_mapped_writable; > } VAPICROMState; > =20 > +#define TYPE_VAPIC_DEVICE "kvmvapic" > +#define VAPIC_DEVICE(obj) OBJECT_CHECK(VAPICROMState, (obj), TYPE_VAPI= C_DEVICE) > + > #define TPR_INSTR_ABS_MODRM 0x1 > #define TPR_INSTR_MATCH_MODRM_REG 0x2 > =20 > @@ -692,7 +695,7 @@ static const MemoryRegionOps vapic_ops =3D { > =20 > static int vapic_init(SysBusDevice *dev) > { > - VAPICROMState *s =3D FROM_SYSBUS(VAPICROMState, dev); > + VAPICROMState *s =3D VAPIC_DEVICE(dev); > =20 > memory_region_init_io(&s->io, &vapic_ops, s, "kvmvapic", 2); > sysbus_add_io(dev, VAPIC_IO_PORT, &s->io); > @@ -808,7 +811,7 @@ static void vapic_class_init(ObjectClass *klass, vo= id *data) > } > =20 > static const TypeInfo vapic_type =3D { > - .name =3D "kvmvapic", > + .name =3D TYPE_VAPIC_DEVICE, > .parent =3D TYPE_SYS_BUS_DEVICE, > .instance_size =3D sizeof(VAPICROMState), > .class_init =3D vapic_class_init, >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg