summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2015-12-02 14:43:40 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:22 -0600
commit67157f9e9746c233d5b130908703c231bfbc573b (patch)
tree781bd71e01a498e754b4e76e503d1aa657fcd84c
parentcec81670ba3b3b91b669a915edf49c0451ae6086 (diff)
downloadhqemu-67157f9e9746c233d5b130908703c231bfbc573b.zip
hqemu-67157f9e9746c233d5b130908703c231bfbc573b.tar.gz
9pfs: factor out pdu_push_and_notify
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
-rw-r--r--hw/9pfs/virtio-9p.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 6d32b81..e97adc8 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -63,6 +63,17 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
return ret;
}
+static void pdu_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 int omode_to_uflags(int8_t mode)
{
int ret = 0;
@@ -653,11 +664,7 @@ static void pdu_complete(V9fsPDU *pdu, ssize_t len)
pdu->size = len;
pdu->id = id;
- /* push onto queue and notify */
- virtqueue_push(s->vq, &pdu->elem, len);
-
- /* FIXME: we should batch these completions */
- virtio_notify(VIRTIO_DEVICE(s), s->vq);
+ pdu_push_and_notify(pdu);
/* Now wakeup anybody waiting in flush for this request */
qemu_co_queue_next(&pdu->complete);
OpenPOWER on IntegriCloud