Commit 5f24d44f authored by Asias He's avatar Asias He Committed by Will Deacon
Browse files

kvm tools: Drop virt_queue__get_used_elem virtio helper

Use virt_queue__set_used_elem instead.

Signed-off-by: default avatarAsias He <>
Signed-off-by: default avatarPekka Enberg <>
parent 416b2c2d
......@@ -26,12 +26,6 @@ static inline struct vring_desc *virt_queue__get_desc(struct virt_queue *queue,
return &queue->vring.desc[desc_ndx];
static inline struct vring_used_elem *virt_queue__get_used_elem(struct virt_queue *queue)
return &queue->vring.used->ring[queue->vring.used->idx++ % queue->vring.num];
static inline bool virt_queue__available(struct virt_queue *vq)
return vq->vring.avail->idx != vq->last_avail_idx;
......@@ -100,7 +100,6 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in
static bool virtio_blk_request(struct kvm *self, struct virt_queue *queue)
struct vring_used_elem *used_elem;
struct virtio_blk_outhdr *req;
uint16_t desc_block_last;
struct vring_desc *desc;
......@@ -190,9 +189,7 @@ static bool virtio_blk_request(struct kvm *self, struct virt_queue *queue)
*status = err_cnt ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK;
used_elem = virt_queue__get_used_elem(queue);
used_elem->id = desc_hdr;
used_elem->len = block_cnt;
virt_queue__set_used_elem(queue, desc_hdr, block_cnt);
return true;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment