summary refs log tree commit diff stats
path: root/include/hw/virtio
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-06-17 14:32:06 +0800
committerKevin Wolf <kwolf@redhat.com>2014-06-27 18:20:32 +0200
commitbf4bd461b43d90c5af30f61f740c1bb675849ab9 (patch)
tree3ac4398bd9dc4ff518e752ae3f666fb87d9bf880 /include/hw/virtio
parent13344f3a17e0a785c0eb8e36f69518f21aa8a91a (diff)
downloadfocaccia-qemu-bf4bd461b43d90c5af30f61f740c1bb675849ab9.tar.gz
focaccia-qemu-bf4bd461b43d90c5af30f61f740c1bb675849ab9.zip
virtio-blk: Make request completion function virtual
virtio_blk_req_complete will call VirtIOBlock.complete_request() to push
data and notify guest. No functional change.

Later, this will allow dataplane to provide it's own (vring_) version.

Signed-off-by: Fam Zheng <famz@redhat.com>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/hw/virtio')
-rw-r--r--include/hw/virtio/virtio-blk.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index 2571e961ec..0398f4c46d 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -117,6 +117,7 @@ struct VirtIOBlkConf
 
 struct VirtIOBlockDataPlane;
 
+struct VirtIOBlockReq;
 typedef struct VirtIOBlock {
     VirtIODevice parent_obj;
     BlockDriverState *bs;
@@ -128,6 +129,8 @@ typedef struct VirtIOBlock {
     unsigned short sector_mask;
     bool original_wce;
     VMChangeStateEntry *change;
+    /* Function to push to vq and notify guest */
+    void (*complete_request)(struct VirtIOBlockReq *req, unsigned char status);
 #ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
     Notifier migration_state_notifier;
     struct VirtIOBlockDataPlane *dataplane;