From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPzEO-0005Jh-KQ for qemu-devel@nongnu.org; Wed, 10 Apr 2013 13:54:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPzEL-0007pE-2E for qemu-devel@nongnu.org; Wed, 10 Apr 2013 13:54:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36086 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPzEK-0007p9-Ov for qemu-devel@nongnu.org; Wed, 10 Apr 2013 13:54:44 -0400 Message-ID: <5165A75E.1070901@suse.de> Date: Wed, 10 Apr 2013 19:54:38 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1365172636-28628-1-git-send-email-imammedo@redhat.com> <1365172636-28628-8-git-send-email-imammedo@redhat.com> In-Reply-To: <1365172636-28628-8-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 07/22] target-i386: kvmvapic: replace FROM_SYSBUS() with QOM type cast List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: aliguori@us.ibm.com, ehabkost@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, jfrei@linux.vnet.ibm.com, yang.z.zhang@intel.com, pbonzini@redhat.com, lig.fnst@cn.fujitsu.com, rth@twiddle.net Am 05.04.2013 16:36, schrieb Igor Mammedov: > ... and define type name and type cast macro for kvmvapic according > to accepted convention. >=20 > Signed-off-by: Igor Mammedov > --- > v2: > * s/VAPIC_DEVICE/VAPIC/; s/TYPE_VAPIC_DEVICE/TYPE_VAPIC/ >=20 > Note: stray cleanup, since I excluded following patch that converted > kvmvapic to ICCDevice It's a valid cleanup of a CPU-related device, so I'm happily taking it. Thanks, applied to qom-cpu (dropping "target-i386"): https://github.com/afaerber/qemu-cpu/commits/qom-cpu Andreas > --- > hw/i386/kvmvapic.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c > index cc95e5c..c4be882 100644 > --- a/hw/i386/kvmvapic.c > +++ b/hw/i386/kvmvapic.c > @@ -60,6 +60,9 @@ typedef struct VAPICROMState { > bool rom_mapped_writable; > } VAPICROMState; > =20 > +#define TYPE_VAPIC "kvmvapic" > +#define VAPIC(obj) OBJECT_CHECK(VAPICROMState, (obj), TYPE_VAPIC) > + > #define TPR_INSTR_ABS_MODRM 0x1 > #define TPR_INSTR_MATCH_MODRM_REG 0x2 > =20 > @@ -690,7 +693,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(dev); > =20 > memory_region_init_io(&s->io, &vapic_ops, s, "kvmvapic", 2); > sysbus_add_io(dev, VAPIC_IO_PORT, &s->io); > @@ -806,7 +809,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, > .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