aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-device.c
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2016-01-07 18:30:29 +0000
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2016-01-08 15:30:03 +0530
commit0d3716b4e6ba81e8632c4ca698488b6e843f9daf (patch)
tree2345df2428a31d6d88e9e3b6e133c4be2d0fc7e6 /hw/9pfs/virtio-9p-device.c
parentebe74f8ba2f1f68b87d7289696acc4741a30d2da (diff)
9pfs: factor out virtio_9p_push_and_notify
The new function resides in virtio specific file. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/virtio-9p-device.c')
-rw-r--r--hw/9pfs/virtio-9p-device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 5cad654d8e..cfad13afe7 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -20,6 +20,17 @@
#include "coth.h"
#include "hw/virtio/virtio-access.h"
+void virtio_9p_push_and_notify(V9fsPDU *pdu)
+{
+ V9fsState *s = pdu->s;
+
+ /* push onto queue and notify */
+ virtqueue_push(s->vq, &pdu->elem, pdu->size);
+
+ /* FIXME: we should batch these completions */
+ virtio_notify(VIRTIO_DEVICE(s), s->vq);
+}
+
static uint64_t virtio_9p_get_features(VirtIODevice *vdev, uint64_t features,
Error **errp)
{