From patchwork Mon Aug 13 08:35:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 176888 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 72BCE2C0080 for ; Mon, 13 Aug 2012 19:15:01 +1000 (EST) Received: from localhost ([::1]:55939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0qBr-0006Ah-PB for incoming@patchwork.ozlabs.org; Mon, 13 Aug 2012 04:39:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0qBC-0004QS-9R for qemu-devel@nongnu.org; Mon, 13 Aug 2012 04:39:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0qBA-00047J-40 for qemu-devel@nongnu.org; Mon, 13 Aug 2012 04:39:18 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:44921 helo=linux-iscsi.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0qB9-000479-VG for qemu-devel@nongnu.org; Mon, 13 Aug 2012 04:39:16 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id 568C822CAC8; Mon, 13 Aug 2012 08:35:37 +0000 (UTC) From: "Nicholas A. Bellinger" To: target-devel Date: Mon, 13 Aug 2012 08:35:17 +0000 Message-Id: <1344846917-7411-7-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1344846917-7411-1-git-send-email-nab@linux-iscsi.org> References: <1344846917-7411-1-git-send-email-nab@linux-iscsi.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 67.23.28.174 Cc: Stefan Hajnoczi , kvm-devel , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel , Nicholas Bellinger , Zhi Yong Wu , Anthony Liguori , Hannes Reinecke , Paolo Bonzini , lf-virt , Christoph Hellwig Subject: [Qemu-devel] [RFC-v2 6/6] virtio-scsi: Fix incorrect VirtIOSCSI->cmd_vqs[0] definition 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 From: Nicholas Bellinger This patch fixes bug in the definition of VirtIOSCSI->cmd_vqs[0], where the return of virtio_add_queue() in virtio_scsi_init() ends up overwriting past the end of ->cmd_vqs[0]. Since virtio_scsi currently assumes a single vqs for data, this patch simply changes ->cmd_vqs[1] to handle the single VirtQueue. Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: Michael S. Tsirkin Signed-off-by: Nicholas Bellinger --- hw/virtio-scsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index 5e2ff6b..2c70f89 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -150,7 +150,7 @@ typedef struct { bool events_dropped; VirtQueue *ctrl_vq; VirtQueue *event_vq; - VirtQueue *cmd_vqs[0]; + VirtQueue *cmd_vqs[1]; bool vhost_started; VHostSCSI *vhost_scsi;