From patchwork Mon Jan 11 17:16:49 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: 42636 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 76222B7BF4 for ; Tue, 12 Jan 2010 04:30:50 +1100 (EST) Received: from localhost ([127.0.0.1]:49957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUO09-00047c-QH for incoming@patchwork.ozlabs.org; Mon, 11 Jan 2010 12:24:25 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUNvk-0008Hj-D6 for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:19:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUNvf-0008Bc-PW for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:19:52 -0500 Received: from [199.232.76.173] (port=57995 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUNvf-0008BL-GT for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:19:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61500) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUNvf-0007qU-43 for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:19:47 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0BHJjgh010058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 Jan 2010 12:19:45 -0500 Received: from redhat.com (vpn2-11-60.ams2.redhat.com [10.36.11.60]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o0BHJhIb023827; Mon, 11 Jan 2010 12:19:43 -0500 Date: Mon, 11 Jan 2010 19:16:49 +0200 From: "Michael S. Tsirkin" To: Anthony Liguori , qemu-devel@nongnu.org Message-ID: <20100111171649.GB11936@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH-RFC 01/13] virtio: export virtqueue structure 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 vhost needs physical addresses for ring so expose that structure. Signed-off-by: Michael S. Tsirkin --- hw/virtio.c | 18 ------------------ hw/virtio.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/hw/virtio.c b/hw/virtio.c index 3c609ce..8e3c9ad 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -49,24 +49,6 @@ typedef struct VRingUsed VRingUsedElem ring[0]; } VRingUsed; -typedef struct VRing -{ - unsigned int num; - target_phys_addr_t desc; - target_phys_addr_t avail; - target_phys_addr_t used; -} VRing; - -struct VirtQueue -{ - VRing vring; - target_phys_addr_t pa; - uint16_t last_avail_idx; - int inuse; - uint16_t vector; - void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq); -}; - #define VIRTIO_PCI_QUEUE_MAX 16 /* virt queue functions */ diff --git a/hw/virtio.h b/hw/virtio.h index 3994cc9..ca840e1 100644 --- a/hw/virtio.h +++ b/hw/virtio.h @@ -180,5 +180,22 @@ void virtio_net_exit(VirtIODevice *vdev); DEFINE_PROP_BIT("indirect_desc", _state, _field, \ VIRTIO_RING_F_INDIRECT_DESC, true) +typedef struct VRing +{ + unsigned int num; + target_phys_addr_t desc; + target_phys_addr_t avail; + target_phys_addr_t used; +} VRing; + +struct VirtQueue +{ + VRing vring; + target_phys_addr_t pa; + uint16_t last_avail_idx; + int inuse; + uint16_t vector; + void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq); +}; #endif