qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion.  I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass
registration functions.

The second step was another sed-based removal of subclass registration functions
while also adding virtual functions from the base class into a class_init
function as appropriate.

Finally, a python script was used to convert the DeviceInfo structures and
qdev_register_subclass functions to TypeInfo structures, class_init functions,
and type_register_static calls.

We are almost fully converted to QOM after this commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 92d8882..a22c5c6 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -125,18 +125,6 @@
     return 0;
 }
 
-void isa_qdev_register_subclass(DeviceInfo *info, const char *parent)
-{
-    info->init = isa_qdev_init;
-    info->bus_info = &isa_bus_info;
-    qdev_register_subclass(info, parent);
-}
-
-void isa_qdev_register(DeviceInfo *info)
-{
-    isa_qdev_register_subclass(info, TYPE_ISA_DEVICE);
-}
-
 ISADevice *isa_create(ISABus *bus, const char *name)
 {
     DeviceState *dev;
@@ -191,30 +179,40 @@
 
 static void isabus_bridge_class_init(ObjectClass *klass, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(klass);
     SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
     k->init = isabus_bridge_init;
+    dc->fw_name = "isa";
+    dc->no_user = 1;
 }
 
-static DeviceInfo isabus_bridge_info = {
-    .name = "isabus-bridge",
-    .fw_name = "isa",
-    .size = sizeof(SysBusDevice),
-    .no_user = 1,
-    .class_init = isabus_bridge_class_init,
+static TypeInfo isabus_bridge_info = {
+    .name          = "isabus-bridge",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(SysBusDevice),
+    .class_init    = isabus_bridge_class_init,
 };
 
+static void isa_device_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *k = DEVICE_CLASS(klass);
+    k->init = isa_qdev_init;
+    k->bus_info = &isa_bus_info;
+}
+
 static TypeInfo isa_device_type_info = {
     .name = TYPE_ISA_DEVICE,
     .parent = TYPE_DEVICE,
     .instance_size = sizeof(ISADevice),
     .abstract = true,
     .class_size = sizeof(ISADeviceClass),
+    .class_init = isa_device_class_init,
 };
 
 static void isabus_register_devices(void)
 {
-    sysbus_register_withprop(&isabus_bridge_info);
+    type_register_static(&isabus_bridge_info);
     type_register_static(&isa_device_type_info);
 }