aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/kvmvapic.c
diff options
context:
space:
mode:
authorHu Tao <hutao@cn.fujitsu.com>2013-07-01 18:18:40 +0800
committerAndreas Färber <afaerber@suse.de>2013-07-23 00:37:35 +0200
commitc118d44b6a6977e4019fe1da82f5c333dbbedcfa (patch)
tree2a98903138651e2f54590bb0fc53564a579e05df /hw/i386/kvmvapic.c
parent913bc63844395f07e317dbc1a5b38612cc75ebec (diff)
downloadqemu-c118d44b6a6977e4019fe1da82f5c333dbbedcfa.zip
qemu-c118d44b6a6977e4019fe1da82f5c333dbbedcfa.tar.gz
qemu-c118d44b6a6977e4019fe1da82f5c333dbbedcfa.tar.bz2
kvmvapic: Use QOM realize
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Renamed variable] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/i386/kvmvapic.c')
-rw-r--r--hw/i386/kvmvapic.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
index ccd089a..365b219 100644
--- a/hw/i386/kvmvapic.c
+++ b/hw/i386/kvmvapic.c
@@ -703,19 +703,18 @@ static const MemoryRegionOps vapic_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int vapic_init(SysBusDevice *dev)
+static void vapic_realize(DeviceState *dev, Error **errp)
{
+ SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
VAPICROMState *s = VAPIC(dev);
memory_region_init_io(&s->io, OBJECT(s), &vapic_ops, s, "kvmvapic", 2);
- sysbus_add_io(dev, VAPIC_IO_PORT, &s->io);
- sysbus_init_ioports(dev, VAPIC_IO_PORT, 2);
+ sysbus_add_io(sbd, VAPIC_IO_PORT, &s->io);
+ sysbus_init_ioports(sbd, VAPIC_IO_PORT, 2);
option_rom[nb_option_roms].name = "kvmvapic.bin";
option_rom[nb_option_roms].bootindex = -1;
nb_option_roms++;
-
- return 0;
}
static void do_vapic_enable(void *data)
@@ -812,13 +811,12 @@ static const VMStateDescription vmstate_vapic = {
static void vapic_class_init(ObjectClass *klass, void *data)
{
- SysBusDeviceClass *sc = SYS_BUS_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
dc->no_user = 1;
dc->reset = vapic_reset;
dc->vmsd = &vmstate_vapic;
- sc->init = vapic_init;
+ dc->realize = vapic_realize;
}
static const TypeInfo vapic_type = {