summaryrefslogtreecommitdiff
path: root/hw/s390-virtio-bus.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-05-02 09:00:20 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-18 15:14:38 +0200
commit0d936928ef87ca1bb7b41b5b89c400c699a7691c (patch)
tree134a900379f06e1e84f31728a866d8afc7e9869a /hw/s390-virtio-bus.c
parent8185d21639ab749979445734ec671122aa96e805 (diff)
downloadqemu-0d936928ef87ca1bb7b41b5b89c400c699a7691c.tar.gz
qdev: Convert busses to QEMU Object Model
This is far less interesting than it sounds. We simply add an Object to each BusState and then register the types appropriately. Most of the interesting refactoring will follow in the next patches. Since we're changing fundamental type names (BusInfo -> BusClass), it all needs to convert at once. Fortunately, not a lot of code is affected. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Made all new bus TypeInfos static const.] [AF: Made qbus_free() call object_delete(), required {qom,glib}_allocated] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/s390-virtio-bus.c')
-rw-r--r--hw/s390-virtio-bus.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 23ef35b3bb..2aec756da1 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -45,9 +45,10 @@
#define VIRTIO_EXT_CODE 0x2603
-struct BusInfo s390_virtio_bus_info = {
- .name = "s390-virtio",
- .size = sizeof(VirtIOS390Bus),
+static const TypeInfo s390_virtio_bus_info = {
+ .name = TYPE_S390_VIRTIO_BUS,
+ .parent = TYPE_BUS,
+ .instance_size = sizeof(VirtIOS390Bus),
};
static const VirtIOBindings virtio_s390_bindings;
@@ -92,7 +93,7 @@ VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
/* Create bus on bridge device */
- _bus = qbus_create(&s390_virtio_bus_info, dev, "s390-virtio");
+ _bus = qbus_create(TYPE_S390_VIRTIO_BUS, dev, "s390-virtio");
bus = DO_UPCAST(VirtIOS390Bus, bus, _bus);
bus->dev_page = *ram_size;
@@ -460,7 +461,7 @@ static void virtio_s390_device_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->init = s390_virtio_busdev_init;
- dc->bus_info = &s390_virtio_bus_info;
+ dc->bus_type = TYPE_S390_VIRTIO_BUS;
dc->unplug = qdev_simple_unplug_cb;
}
@@ -521,6 +522,7 @@ static TypeInfo s390_virtio_bridge_info = {
static void s390_virtio_register_types(void)
{
+ type_register_static(&s390_virtio_bus_info);
type_register_static(&virtio_s390_device_info);
type_register_static(&s390_virtio_serial);
type_register_static(&s390_virtio_blk);