From patchwork Mon Sep 27 16:32:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 65880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E515FB70D5 for ; Tue, 28 Sep 2010 02:42:42 +1000 (EST) Received: from localhost ([127.0.0.1]:57445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0Gml-0004bi-KB for incoming@patchwork.ozlabs.org; Mon, 27 Sep 2010 12:42:39 -0400 Received: from [140.186.70.92] (port=37658 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0GjV-000378-DU for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:39:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0GjO-00048v-GB for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:39:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49627) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0GjO-00048j-1V for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:39:10 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8RGcwGL032511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Sep 2010 12:38:59 -0400 Received: from redhat.com (vpn1-4-251.ams2.redhat.com [10.36.4.251]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o8RGcuRZ025154; Mon, 27 Sep 2010 12:38:57 -0400 Date: Mon, 27 Sep 2010 18:32:52 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, Anthony Liguori , Alex Williamson Message-ID: <20100927163252.GA7071@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] virtio: invoke set_status callback on reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As status is set to 0 on reset, invoke the relevant callback. This makes for a cleaner code in devices as they don't need to duplicate the code in their reset routine, as well as excercises this path a little more. Signed-off-by: Michael S. Tsirkin --- hw/virtio.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/virtio.c b/hw/virtio.c index 4475bb3..d7b5853 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -443,6 +443,8 @@ void virtio_reset(void *opaque) VirtIODevice *vdev = opaque; int i; + virtio_set_status(vdev, 0); + if (vdev->reset) vdev->reset(vdev);