hw/s390x/ccw: Register qbus type in abstract TYPE_CCW_DEVICE parent
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sat, 24 Apr 2021 14:53:13 +0000 (16:53 +0200)
committerCornelia Huck <cohuck@redhat.com>
Thu, 20 May 2021 12:19:30 +0000 (14:19 +0200)
Instead of having all TYPE_CCW_DEVICE children set the bus type to
TYPE_VIRTUAL_CSS_BUS, do it once in the abstract parent.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <20210424145313.3287400-1-f4bug@amsat.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/s390x/3270-ccw.c
hw/s390x/ccw-device.c
hw/s390x/ccw-device.h
hw/s390x/s390-ccw.c
hw/s390x/virtio-ccw.c

index 25e628f575730b8a6ac62b442f5be60f4204c5db..13e93d8d8f613d912117a607246641166bdd0ce9 100644 (file)
@@ -158,7 +158,6 @@ static void emulated_ccw_3270_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     device_class_set_props(dc, emulated_ccw_3270_properties);
-    dc->bus_type = TYPE_VIRTUAL_CSS_BUS;
     dc->realize = emulated_ccw_3270_realize;
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
index c9707110e9c8d1b570944f377f5b170194edd994..95f269ab441e7b558b7ce0fef4e67d4fc33aef87 100644 (file)
@@ -59,6 +59,7 @@ static void ccw_device_class_init(ObjectClass *klass, void *data)
     k->refill_ids = ccw_device_refill_ids;
     device_class_set_props(dc, ccw_device_properties);
     dc->reset = ccw_device_reset;
+    dc->bus_type = TYPE_VIRTUAL_CSS_BUS;
 }
 
 const VMStateDescription vmstate_ccw_dev = {
index 832c78cd4213194794e14df60278d042bfad2d2c..6dff95225df11c63f9b66975019026b215c8c448 100644 (file)
@@ -14,6 +14,7 @@
 #include "qom/object.h"
 #include "hw/qdev-core.h"
 #include "hw/s390x/css.h"
+#include "hw/s390x/css-bridge.h"
 
 struct CcwDevice {
     DeviceState parent_obj;
index 242491a1aea0ead790ff7ddd61fbb5d050efde3c..c227c77984cec2aeff9a79da20be3b97ec79eaf3 100644 (file)
@@ -176,10 +176,8 @@ static void s390_ccw_instance_init(Object *obj)
 
 static void s390_ccw_class_init(ObjectClass *klass, void *data)
 {
-    DeviceClass *dc = DEVICE_CLASS(klass);
     S390CCWDeviceClass *cdc = S390_CCW_DEVICE_CLASS(klass);
 
-    dc->bus_type = TYPE_VIRTUAL_CSS_BUS;
     cdc->realize = s390_ccw_realize;
     cdc->unrealize = s390_ccw_unrealize;
 }
index 92b950e09a134d087ba4f5355cfea490cc694e71..220b9efcf9459a55020b3a023487fbe28f2f8460 100644 (file)
@@ -1234,7 +1234,6 @@ static void virtio_ccw_device_class_init(ObjectClass *klass, void *data)
     k->unplug = virtio_ccw_busdev_unplug;
     dc->realize = virtio_ccw_busdev_realize;
     dc->unrealize = virtio_ccw_busdev_unrealize;
-    dc->bus_type = TYPE_VIRTUAL_CSS_BUS;
     device_class_set_parent_reset(dc, virtio_ccw_reset, &vdc->parent_reset);
 }