diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-01-10 04:40:25 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-01-29 21:50:04 +0100 |
commit | 93726cb31982f5d930a4d5838215307390636d9b (patch) | |
tree | 79d8193358c3c2cb71c54363240bfd9289fc0687 /hw/s390-virtio-bus.c | |
parent | 49973ebc039f644fce3e73ff8019efaa795bd83b (diff) |
virtio-s390: add a reset function to virtio-s390 devices
virtio-s390 devices are not being reset when their bus is. To fix
this, add a reset method that forwards to virtio_reset. This is
only needed because of the "strange" modeling of virtio devices;
the ->vdev link is being handled manually rather than through qdev.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/s390-virtio-bus.c')
-rw-r--r-- | hw/s390-virtio-bus.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index b5d1f2be16..6858db0895 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -508,6 +508,13 @@ static int s390_virtio_busdev_init(DeviceState *dev) return _info->init(_dev); } +static void s390_virtio_busdev_reset(DeviceState *dev) +{ + VirtIOS390Device *_dev = (VirtIOS390Device *)dev; + + virtio_reset(_dev->vdev); +} + static void virtio_s390_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -515,6 +522,7 @@ static void virtio_s390_device_class_init(ObjectClass *klass, void *data) dc->init = s390_virtio_busdev_init; dc->bus_type = TYPE_S390_VIRTIO_BUS; dc->unplug = qdev_simple_unplug_cb; + dc->reset = s390_virtio_busdev_reset; } static const TypeInfo virtio_s390_device_info = { |