Received: from eggs.gnu.org ([208.118.235.92]:49943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBae-0000j5-66 for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWBaa-0002IC-5R for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41919 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBaZ-0002GZ-HW for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:19 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 209E35E000209 for ; Sat, 27 Apr 2013 22:19:19 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 27 Apr 2013 22:18:51 +0200 Message-Id: <1367093935-29091-17-git-send-email-afaerber@suse.de> In-Reply-To: <1367093935-29091-1-git-send-email-afaerber@suse.de> References: <1367093935-29091-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-1.5 v2 16/20] sga: QOM'ify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Introduce type constant and cast macro. Prepares for ISA realizefn. Signed-off-by: Andreas F=C3=A4rber --- hw/misc/sga.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 5cf4b86..c842190 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -31,8 +31,11 @@ =20 #define SGABIOS_FILENAME "sgabios.bin" =20 -typedef struct ISAGAState { - ISADevice dev; +#define TYPE_SGA "sga" +#define SGA(obj) OBJECT_CHECK(ISASGAState, (obj), TYPE_SGA) + +typedef struct ISASGAState { + ISADevice parent_obj; } ISASGAState; =20 static int sga_initfn(ISADevice *dev) @@ -40,6 +43,7 @@ static int sga_initfn(ISADevice *dev) rom_add_vga(SGABIOS_FILENAME); return 0; } + static void sga_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -49,7 +53,7 @@ static void sga_class_initfn(ObjectClass *klass, void *= data) } =20 static const TypeInfo sga_info =3D { - .name =3D "sga", + .name =3D TYPE_SGA, .parent =3D TYPE_ISA_DEVICE, .instance_size =3D sizeof(ISASGAState), .class_init =3D sga_class_initfn, --=20 1.8.1.4