From patchwork Mon Jan 7 18:40:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.konrad@greensocs.com X-Patchwork-Id: 210044 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 293212C00B5 for ; Tue, 8 Jan 2013 05:51:32 +1100 (EST) Received: from localhost ([::1]:38781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHnG-00075b-8O for incoming@patchwork.ozlabs.org; Mon, 07 Jan 2013 13:51:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHeF-0004xX-P4 for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:42:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsHe9-0005p1-V5 for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:42:11 -0500 Received: from greensocs.com ([87.106.252.221]:52800 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHe9-0005om-Ow for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:42:05 -0500 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id 38942439E41; Mon, 7 Jan 2013 18:42:05 +0000 (UTC) Received: from s15328186.onlinehome-server.info ([127.0.0.1]) by localhost (s15328186.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kJs0FqxAlrhC; Mon, 7 Jan 2013 19:42:03 +0100 (CET) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id 24798439E4E; Mon, 7 Jan 2013 19:41:58 +0100 (CET) Received: from compaq.katmai.xl.cx.katmai.xl.cx (lan31-11-83-155-143-136.fbx.proxad.net [83.155.143.136]) by s15328186.onlinehome-server.info (Postfix) with ESMTPSA id 51AB7439E46; Mon, 7 Jan 2013 19:41:57 +0100 (CET) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com Date: Mon, 7 Jan 2013 19:40:35 +0100 Message-Id: <1357584074-10852-23-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> References: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 87.106.252.221 Cc: kwolf@redhat.com, peter.maydell@linaro.org, e.voevodin@samsung.com, mst@redhat.com, mark.burton@greensocs.com, agraf@suse.de, amit.shah@redhat.com, aneesh.kumar@linux.vnet.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH 22/61] virtio-scsi : show the VirtIOSCSI structure. 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: KONRAD Frederic As we discuss with anthony and andreas, this structure must be showed to avoid two memory allocations for virtio-scsi-x. Signed-off-by: KONRAD Frederic --- hw/virtio-scsi.c | 15 --------------- hw/virtio-scsi.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index bfe1860..4e2d884 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -129,21 +129,6 @@ typedef struct { uint32_t max_lun; } QEMU_PACKED VirtIOSCSIConfig; -typedef struct { - VirtIODevice vdev; - DeviceState *qdev; - VirtIOSCSIConf *conf; - - SCSIBus bus; - uint32_t sense_size; - uint32_t cdb_size; - int resetting; - bool events_dropped; - VirtQueue *ctrl_vq; - VirtQueue *event_vq; - VirtQueue *cmd_vqs[0]; -} VirtIOSCSI; - typedef struct VirtIOSCSIReq { VirtIOSCSI *dev; VirtQueue *vq; diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h index 8d9d15f..38b9c0f 100644 --- a/hw/virtio-scsi.h +++ b/hw/virtio-scsi.h @@ -16,6 +16,7 @@ #include "virtio.h" #include "pci/pci.h" +#include /* The ID for virtio_scsi */ #define VIRTIO_ID_SCSI 8 @@ -31,6 +32,21 @@ struct VirtIOSCSIConf { uint32_t cmd_per_lun; }; +typedef struct { + VirtIODevice vdev; + DeviceState *qdev; + VirtIOSCSIConf *conf; + + SCSIBus bus; + uint32_t sense_size; + uint32_t cdb_size; + int resetting; + bool events_dropped; + VirtQueue *ctrl_vq; + VirtQueue *event_vq; + VirtQueue *cmd_vqs[0]; +} VirtIOSCSI; + #define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _features_field, _conf_field) \ DEFINE_VIRTIO_COMMON_FEATURES(_state, _features_field), \ DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \