Skip to content

Commit

Permalink
virtio-s390: add a reset function to virtio-s390 devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini authored and agraf committed Jan 29, 2013
1 parent 49973eb commit 93726cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hw/s390-virtio-bus.c
Expand Up @@ -508,13 +508,21 @@ 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);

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 = {
Expand Down

0 comments on commit 93726cb

Please sign in to comment.