From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVJ-0008W0-38 for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkdVH-0008HW-V9 for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:20 -0500 Received: from mail-ia0-f173.google.com ([209.85.210.173]:60430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVH-0008HS-RA for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:19 -0500 Received: by mail-ia0-f173.google.com with SMTP id w21so5709832iac.4 for ; Mon, 17 Dec 2012 08:25:19 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 17 Dec 2012 17:24:40 +0100 Message-Id: <1355761490-10073-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> References: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 05/15] virtio-s390: add a reset function to virtio-s390 devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com 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 --- hw/s390-virtio-bus.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index e0ac2d1..34173a7 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -492,6 +492,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); @@ -499,6 +506,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 TypeInfo virtio_s390_device_info = { -- 1.8.0.2