[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/25] 9pfs: factor out virtio_9p_push_and_notify
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-devel] [PATCH 19/25] 9pfs: factor out virtio_9p_push_and_notify |
Date: |
Tue, 12 Jan 2016 11:38:26 +0530 |
From: Wei Liu <address@hidden>
The new function resides in virtio specific file.
Signed-off-by: Wei Liu <address@hidden>
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
hw/9pfs/virtio-9p-device.c | 11 +++++++++++
hw/9pfs/virtio-9p.c | 8 +-------
hw/9pfs/virtio-9p.h | 2 ++
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 5cad654d8e65..cfad13afe7e9 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)
{
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 2bd862fd94da..691a1d91f21b 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -65,13 +65,7 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const
char *fmt, ...)
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);
+ virtio_9p_push_and_notify(pdu);
}
static int omode_to_uflags(int8_t mode)
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h
index b4d344af9506..a1ac3980ee73 100644
--- a/hw/9pfs/virtio-9p.h
+++ b/hw/9pfs/virtio-9p.h
@@ -6,6 +6,8 @@
#include "9p.h"
extern void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq);
+extern void virtio_9p_push_and_notify(V9fsPDU *pdu);
+
ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
const char *fmt, va_list ap);
ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
--
2.5.0
- [Qemu-devel] [PATCH 08/25] 9pfs: merge hw/virtio/virtio-9p.h into hw/9pfs/virtio-9p.h, (continued)
- [Qemu-devel] [PATCH 08/25] 9pfs: merge hw/virtio/virtio-9p.h into hw/9pfs/virtio-9p.h, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 24/25] 9pfs: factor out v9fs_device_{, un}realize_common, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 01/25] 9pfs: rename virtio-9p-coth.{c, h} to coth.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 15/25] 9pfs: factor out virtio_pdu_{, un}marshal, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 03/25] 9pfs: rename virtio-9p-local.c to 9p-local.c, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 09/25] 9pfs: remove dead code, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 21/25] 9pfs: move handle_9p_output and make it static function, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 18/25] 9pfs: break out 9p.h from virtio-9p.h, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 10/25] fsdev: break out 9p-marshal.{c, h} from virtio-9p-marshal.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 02/25] 9pfs: rename virtio-9p-handle.c to 9p-handle.c, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 19/25] 9pfs: factor out virtio_9p_push_and_notify,
Aneesh Kumar K.V <=
- [Qemu-devel] [PATCH 11/25] fsdev: rename virtio-9p-marshal.{c, h} to 9p-iov-marshal.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 07/25] 9pfs: rename virtio-9p-xattr{, -user}.{c, h} to 9p-xattr{, -user}.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 14/25] 9pfs: make pdu_{, un}marshal proper functions, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 23/25] 9pfs: rename virtio-9p.c to 9p.c, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 17/25] 9pfs: break out virtio_init_iov_from_pdu, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 20/25] 9pfs: export pdu_{submit,alloc,free}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 16/25] 9pfs: factor out pdu_push_and_notify, Aneesh Kumar K.V, 2016/01/12
- Re: [Qemu-devel] [PULL 00/25] VirtFS update, Peter Maydell, 2016/01/12