From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Mon, 11 Jan 2010 19:16:49 +0200 From: "Michael S. Tsirkin" Message-ID: <20100111171649.GB11936@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCH-RFC 01/13] virtio: export virtqueue structure List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@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 -- 1.6.6.rc1.43.gf55cc