summaryrefslogtreecommitdiff
path: root/hw/i386/kvmvapic.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-07-23 10:56:55 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-07-23 10:56:55 -0500
commit931f0adf64261bf7eb3efaafb4430c04a6a3e6f6 (patch)
tree4dedbea9096972d9215cfb1358f57e6e3acd8d43 /hw/i386/kvmvapic.c
parent3464700f6aecb3e2aa9098839d90672d6b3fa974 (diff)
parent52785d99513e4f5d8c3d94f4362ff54aba88f33c (diff)
downloadqemu-931f0adf64261bf7eb3efaafb4430c04a6a3e6f6.tar.gz
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
QOM device refactorings * Avoid TYPE_* in VMStateDescription name * Replace some DO_UPCAST()s and FROM_SYSBUS()s with QOM casts * Limit legacy SCSI command line handling to non-hotplugged devices * Replace some SysBusDeviceClass::init with DeviceClass::realize # gpg: Signature made Mon 22 Jul 2013 06:31:42 PM CDT using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Hu Tao (26) and others # Via Andreas Färber * afaerber/tags/qom-devices-for-anthony: (55 commits) isa-bus: Drop isabus_bridge_init() since it does nothing ioapic: Use QOM realize for ioapic kvmvapic: Use QOM realize kvm/clock: Use QOM realize for kvmclock hpet: Use QOM realize for hpet scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline() megasas: Legacy command line handling fix scsi/esp: Use QOM realize for scsi esp fw_cfg: Use QOM realize for fw_cfg ahci: Use QOM realize for ahci pflash_cfi02: Use QOM realize for pflash_cfi02 pflash_cfi01: Use QOM realize for pflash_cfi01 fdc: Improve error propagation for QOM realize fdc: Use QOM realize for fdc kvm/clock: QOM'ify some more hpet: QOM'ify some more scsi/esp: QOM'ify some more fwcfg: QOM'ify some more ahci: QOM'ify some more pflash-cfi02: QOM'ify some more ...
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 ccd089a40e..365b2197a1 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 = {