]> git.proxmox.com Git - qemu.git/commitdiff
sga: QOM'ify
authorAndreas Färber <afaerber@suse.de>
Sat, 27 Apr 2013 20:18:51 +0000 (22:18 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 29 Apr 2013 13:27:49 +0000 (08:27 -0500)
Introduce type constant and cast macro.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-17-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/misc/sga.c

index 5cf4b86c4f8f578a094719081ba3cf06f1c461a6..c84219099952a5a8242950a09171a86d979f2092 100644 (file)
 
 #define SGABIOS_FILENAME "sgabios.bin"
 
-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;
 
 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 = DEVICE_CLASS(klass);
@@ -49,7 +53,7 @@ static void sga_class_initfn(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo sga_info = {
-    .name          = "sga",
+    .name          = TYPE_SGA,
     .parent        = TYPE_ISA_DEVICE,
     .instance_size = sizeof(ISASGAState),
     .class_init    = sga_class_initfn,