From patchwork Thu Jan 10 14:40:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 211023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 55FF52C0334 for ; Fri, 11 Jan 2013 01:40:54 +1100 (EST) Received: from localhost ([::1]:53428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtJJM-00051l-E6 for incoming@patchwork.ozlabs.org; Thu, 10 Jan 2013 09:40:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtJJD-00051V-JA for qemu-devel@nongnu.org; Thu, 10 Jan 2013 09:40:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtJJ6-0004kR-Og for qemu-devel@nongnu.org; Thu, 10 Jan 2013 09:40:42 -0500 Received: from mail-vb0-f52.google.com ([209.85.212.52]:40872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtJJ5-0004k1-H1; Thu, 10 Jan 2013 09:40:36 -0500 Received: by mail-vb0-f52.google.com with SMTP id ez10so457622vbb.25 for ; Thu, 10 Jan 2013 06:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=uX03PMjSa5dnsOltR5lmSafHse2+BJUVooPYwnlqL1U=; b=nJe+fOXrrE6YFGwa6R+/scpw0NLBRR3ic/qFVS04lhdxE1pBAskcxzIBJ+OzSmWVMM uZj7kt14wJhq+rjFJFLnfX2hnVNWR7hRIa/7kuoR3AguRN40LWZisdWtgeZ6TfID9ASi RY2OBAnCCU9Dougjk+8Zp4jTziw49rSu3Ld+WQj1iRXnUkihL5wFSLCsE4fOLaudGZnP Gn1jqqRnUS3U4uqnXdt3gSJ+KBjzldkSy7RrHt0QBspqA9curMf012zNj8VxO5RLmkSv BNAKDFHMokW/SOrB9gve4LabsKqE8lLtJtBFJaiQv1ysvsxAQ0GuJZbr2KUWmdnqLuFw 4jzQ== X-Received: by 10.52.38.163 with SMTP id h3mr81042455vdk.35.1357828832532; Thu, 10 Jan 2013 06:40:32 -0800 (PST) Received: from yakj.usersys.redhat.com (93-34-179-137.ip50.fastwebnet.it. [93.34.179.137]) by mx.google.com with ESMTPS id bj15sm475862vdc.7.2013.01.10.06.40.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 10 Jan 2013 06:40:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2013 15:40:25 +0100 Message-Id: <1357828825-2414-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.52 Cc: agraf@suse.de, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 7e99175..1e3e4f0 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -505,6 +505,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); @@ -512,6 +519,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 = {