summaryrefslogtreecommitdiff
path: root/hw/virtio.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-08-03 16:54:38 +0200
committerKevin Wolf <kwolf@redhat.com>2010-08-30 18:29:19 +0200
commit42fb2e0720511fa1da2f8e751be393f851b71d80 (patch)
tree4ec0b019a07d515052cec01c4a2b622301cd77e6 /hw/virtio.h
parent02a89b219039621c940863aa5a9da4fec81a1546 (diff)
downloadqemu-42fb2e0720511fa1da2f8e751be393f851b71d80.tar.gz
qemu-42fb2e0720511fa1da2f8e751be393f851b71d80.tar.bz2
qemu-42fb2e0720511fa1da2f8e751be393f851b71d80.zip
virtio: Factor virtqueue_map_sg out
Separate the mapping of requests to host memory from the descriptor iteration. The next patch will make use of it in a different context. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/virtio.h')
-rw-r--r--hw/virtio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio.h b/hw/virtio.h
index 5836ab61e7..1deeb2cb9c 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -81,6 +81,7 @@ typedef struct VirtQueueElement
unsigned int out_num;
unsigned int in_num;
target_phys_addr_t in_addr[VIRTQUEUE_MAX_SIZE];
+ target_phys_addr_t out_addr[VIRTQUEUE_MAX_SIZE];
struct iovec in_sg[VIRTQUEUE_MAX_SIZE];
struct iovec out_sg[VIRTQUEUE_MAX_SIZE];
} VirtQueueElement;
@@ -142,6 +143,8 @@ void virtqueue_flush(VirtQueue *vq, unsigned int count);
void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
unsigned int len, unsigned int idx);
+void virtqueue_map_sg(struct iovec *sg, target_phys_addr_t *addr,
+ size_t num_sg, int is_write);
int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem);
int virtqueue_avail_bytes(VirtQueue *vq, int in_bytes, int out_bytes);