Patchwork [23/26] kvmvapic realize

login
register
mail settings
Submitter Hu Tao
Date June 22, 2013, 8:50 a.m.
Message ID <8369cf331ca9df00026af1095893df721c978343.1371804804.git.hutao@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/253385/
State New
Headers show

Comments

Hu Tao - June 22, 2013, 8:50 a.m.
Cc: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 hw/i386/kvmvapic.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Patch

diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
index 655483b..06d290c 100644
--- a/hw/i386/kvmvapic.c
+++ b/hw/i386/kvmvapic.c
@@ -698,19 +698,18 @@  static const MemoryRegionOps vapic_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-static int vapic_init(SysBusDevice *dev)
+static void vapic_realize(DeviceState *dev, Error **errp)
 {
     VAPICROMState *s = VAPIC(dev);
+    SysBusDevice *bus = SYS_BUS_DEVICE(dev);
 
     memory_region_init_io(&s->io, &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(bus, VAPIC_IO_PORT, &s->io);
+    sysbus_init_ioports(bus, 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)
@@ -806,13 +805,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 = {