diff options
author | Andreas Färber <afaerber@suse.de> | 2013-04-27 22:18:51 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-29 08:27:49 -0500 |
commit | b582b5a398975d875d7e0b1c8f90817d01a8b20a (patch) | |
tree | 8407ee07056d03b334bc72077d97a544ff855d50 | |
parent | eeceb0849de2126185cf71860a449667fac2f0d7 (diff) |
sga: QOM'ify
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>
-rw-r--r-- | hw/misc/sga.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 5cf4b86c4f..c842190999 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -31,8 +31,11 @@ #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, |