[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/25] 9pfs: factor out virtio_pdu_{, un}marshal
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-devel] [PATCH 15/25] 9pfs: factor out virtio_pdu_{, un}marshal |
Date: |
Tue, 12 Jan 2016 11:38:22 +0530 |
From: Wei Liu <address@hidden>
Signed-off-by: Wei Liu <address@hidden>
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
hw/9pfs/virtio-9p-device.c | 14 ++++++++++++++
hw/9pfs/virtio-9p.c | 6 ++----
hw/9pfs/virtio-9p.h | 5 +++++
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index f3091cc813e7..d77247f3cdad 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -156,6 +156,20 @@ static void virtio_9p_device_unrealize(DeviceState *dev,
Error **errp)
g_free(s->tag);
}
+ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
+ const char *fmt, va_list ap)
+{
+ return v9fs_iov_vmarshal(pdu->elem.in_sg, pdu->elem.in_num,
+ offset, 1, fmt, ap);
+}
+
+ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
+ const char *fmt, va_list ap)
+{
+ return v9fs_iov_vunmarshal(pdu->elem.out_sg, pdu->elem.out_num,
+ offset, 1, fmt, ap);
+}
+
/* virtio-9p device */
static Property virtio_9p_properties[] = {
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index a740f85625a3..6d32b81faa25 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -45,8 +45,7 @@ ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char
*fmt, ...)
va_list ap;
va_start(ap, fmt);
- ret = v9fs_iov_vmarshal(pdu->elem.in_sg, pdu->elem.in_num,
- offset, 1, fmt, ap);
+ ret = virtio_pdu_vmarshal(pdu, offset, fmt, ap);
va_end(ap);
return ret;
@@ -58,8 +57,7 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char
*fmt, ...)
va_list ap;
va_start(ap, fmt);
- ret = v9fs_iov_vunmarshal(pdu->elem.out_sg, pdu->elem.out_num,
- offset, 1, fmt, ap);
+ ret = virtio_pdu_vunmarshal(pdu, offset, fmt, ap);
va_end(ap);
return ret;
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h
index d6f3ac08a76a..e298949fde40 100644
--- a/hw/9pfs/virtio-9p.h
+++ b/hw/9pfs/virtio-9p.h
@@ -323,6 +323,11 @@ extern int v9fs_name_to_path(V9fsState *s, V9fsPath
*dirpath,
ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...);
ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...);
+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,
+ const char *fmt, va_list ap);
+
#define TYPE_VIRTIO_9P "virtio-9p-device"
#define VIRTIO_9P(obj) \
OBJECT_CHECK(V9fsState, (obj), TYPE_VIRTIO_9P)
--
2.5.0
- [Qemu-devel] [PATCH 05/25] 9pfs: rename virtio-9p-proxy.{c, h} to 9p-proxy.{c, h}, (continued)
- [Qemu-devel] [PATCH 05/25] 9pfs: rename virtio-9p-proxy.{c, h} to 9p-proxy.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 04/25] 9pfs: rename virtio-9p-posix-acl.c to 9p-posix-acl.c, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 13/25] 9pfs: PDU processing functions should start pdu_ prefix, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 22/25] 9pfs: rename virtio_9p_set_fd_limit to use v9fs_ prefix, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 12/25] 9pfs: PDU processing functions don't need to take V9fsState as argument, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 25/25] 9pfs: introduce V9fsVirtioState, Aneesh Kumar K.V, 2016/01/12
- [Qemu-devel] [PATCH 06/25] 9pfs: rename virtio-9p-synth.{c, h} to 9p-synth.{c, h}, Aneesh Kumar K.V, 2016/01/12
- [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 <=
- [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, 2016/01/12
- [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