From patchwork Wed Sep 15 16:31:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 64848 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 CC13DB6F14 for ; Thu, 16 Sep 2010 02:38:41 +1000 (EST) Received: from localhost ([127.0.0.1]:50515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovv08-0003Cl-FT for incoming@patchwork.ozlabs.org; Wed, 15 Sep 2010 12:38:28 -0400 Received: from [140.186.70.92] (port=40967 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovutq-00076x-Bw for qemu-devel@nongnu.org; Wed, 15 Sep 2010 12:32:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovutl-0000sw-0n for qemu-devel@nongnu.org; Wed, 15 Sep 2010 12:31:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31438) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovutk-0000sq-MF for qemu-devel@nongnu.org; Wed, 15 Sep 2010 12:31:52 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8FGVjns014868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Sep 2010 12:31:48 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8FGVij0023442; Wed, 15 Sep 2010 12:31:45 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 0C6CB18D471; Wed, 15 Sep 2010 18:31:44 +0200 (IST) Date: Wed, 15 Sep 2010 18:31:44 +0200 From: Gleb Natapov To: seabios@seabios.org Message-ID: <20100915163144.GM3008@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] fix virtio-blk failure after reboot 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 vring_virtqueue should be zeroed otherwise old values will be reused after reboot. Signed-off-by: Gleb Natapov Acked-by: Michael S. Tsirkin --- Gleb. diff --git a/src/virtio-blk.c b/src/virtio-blk.c index 34d7863..7a25826 100644 --- a/src/virtio-blk.c +++ b/src/virtio-blk.c @@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf) goto fail; } memset(vdrive_g, 0, sizeof(*vdrive_g)); + memset(vq, 0, sizeof(*vq)); vdrive_g->drive.type = DTYPE_VIRTIO; vdrive_g->drive.cntl_id = bdf; vdrive_g->vq = vq;