[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 21/27] 9pfs: factor out virtio_9p_push_and_no
From: |
Aneesh Kumar K.V |
Subject: |
Re: [Qemu-devel] [PATCH v2 21/27] 9pfs: factor out virtio_9p_push_and_notify |
Date: |
Fri, 08 Jan 2016 15:27:49 +0530 |
User-agent: |
Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) |
Wei Liu <address@hidden> writes:
> The new function resides in virtio specific file.
>
> Signed-off-by: Wei Liu <address@hidden>
> ---
> v2: new, part of original "9pfs: break out generic code from
> virtio-9p.{c,h}"
> ---
> 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 5cad654..cfad13a 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 3c39247..0ba2312 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 b4d344a..a1ac398 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.1.4
How is this different from pdu_push_notify added by [PATCH 18/27]
-aneesh
- [Qemu-devel] [PATCH v2 18/27] 9pfs: factor out pdu_push_and_notify, (continued)
- [Qemu-devel] [PATCH v2 18/27] 9pfs: factor out pdu_push_and_notify, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 17/27] 9pfs: factor out virtio_pdu_{, un}marshal, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 23/27] 9pfs: move handle_9p_output and make it static function, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 27/27] 9pfs: disentangle V9fsState, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 20/27] 9pfs: break out 9p.h from virtio-9p.h, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 25/27] 9pfs: rename virtio-9p.c to 9p.c, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 11/27] fsdev: 9p-marshal: introduce V9fsBlob, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 21/27] 9pfs: factor out virtio_9p_push_and_notify, Wei Liu, 2016/01/07
- Re: [Qemu-devel] [PATCH v2 21/27] 9pfs: factor out virtio_9p_push_and_notify,
Aneesh Kumar K.V <=
- [Qemu-devel] [PATCH v2 19/27] 9pfs: break out virtio_init_iov_from_pdu, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 22/27] 9pfs: export pdu_{submit, alloc, free}, Wei Liu, 2016/01/07
- [Qemu-devel] [PATCH v2 15/27] 9pfs: PDU processing functions should start pdu_ prefix, Wei Liu, 2016/01/07
- Re: [Qemu-devel] [PATCH v2 00/27] 9pfs: disentangling virtio and generic code, Aneesh Kumar K.V, 2016/01/08