[RFC PATCH 06/20] Introduce iovec util functions, qemu_iovec_to_vector() and qemu_iovec_to_size().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@xxxxxxxxxxxxx>
---
 cutils.c      |   12 ++++++++++++
 qemu-common.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/cutils.c b/cutils.c
index be99b21..1d35590 100644
--- a/cutils.c
+++ b/cutils.c
@@ -238,3 +238,15 @@ void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count)
         count -= copy;
     }
 }
+
+void qemu_iovec_to_vector(QEMUIOVector *qiov, struct iovec **iov, int *count)
+{
+    *iov = qiov->iov;
+    *count = qiov->niov;
+}
+
+void qemu_iovec_to_size(QEMUIOVector *qiov, size_t *size)
+{
+    *size = qiov->size;
+}
+
diff --git a/qemu-common.h b/qemu-common.h
index 2e5f3a7..0af30d2 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -273,6 +273,8 @@ void qemu_iovec_destroy(QEMUIOVector *qiov);
 void qemu_iovec_reset(QEMUIOVector *qiov);
 void qemu_iovec_to_buffer(QEMUIOVector *qiov, void *buf);
 void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count);
+void qemu_iovec_to_vector(QEMUIOVector *qiov, struct iovec **iov, int *niov);
+void qemu_iovec_to_size(QEMUIOVector *qiov, size_t *size);
 
 struct Monitor;
 typedef struct Monitor Monitor;
-- 
1.7.0.31.g1df487

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux