summaryrefslogtreecommitdiffstats
path: root/hw/s390x/ccw-device.c
diff options
context:
space:
mode:
authorCornelia Huck2018-05-07 15:27:57 +0200
committerCornelia Huck2018-05-14 17:10:02 +0200
commit838fb84f83c84f00d15b1bede5e080b495644458 (patch)
tree5b46969cc9e0ee5fa7d2f2932dcec9fdeacc2ea8 /hw/s390x/ccw-device.c
parentvirtio-ccw: common reset handler (diff)
downloadqemu-838fb84f83c84f00d15b1bede5e080b495644458.tar.gz
qemu-838fb84f83c84f00d15b1bede5e080b495644458.tar.xz
qemu-838fb84f83c84f00d15b1bede5e080b495644458.zip
s390x/ccw: make sure all ccw devices are properly reset
Thomas reported that the subchannel for a 3270 device that ended up in a broken state (status pending even though not enabled) did not get out of that state even after a reboot (which involves a subsytem reset). The reason for this is that the 3270 device did not define a reset handler. Let's fix this by introducing a base reset handler (set up for all ccw devices) that resets the subchannel and have virtio-ccw call its virtio-specific reset procedure in addition to that. CC: qemu-stable@nongnu.org Reported-by: Thomas Huth <thuth@redhat.com> Suggested-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x/ccw-device.c')
-rw-r--r--hw/s390x/ccw-device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c
index f9bfa154d6..7cd73df4aa 100644
--- a/hw/s390x/ccw-device.c
+++ b/hw/s390x/ccw-device.c
@@ -40,6 +40,13 @@ static Property ccw_device_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
+static void ccw_device_reset(DeviceState *d)
+{
+ CcwDevice *ccw_dev = CCW_DEVICE(d);
+
+ css_reset_sch(ccw_dev->sch);
+}
+
static void ccw_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -48,6 +55,7 @@ static void ccw_device_class_init(ObjectClass *klass, void *data)
k->realize = ccw_device_realize;
k->refill_ids = ccw_device_refill_ids;
dc->props = ccw_device_properties;
+ dc->reset = ccw_device_reset;
}
const VMStateDescription vmstate_ccw_dev = {