Patchwork [RFC,03/16] qemu-file: Add set/get tmp_visitor

login
register
mail settings
Submitter Dave Gilbert
Date March 25, 2014, 8:17 p.m.
Message ID <1395778647-30925-4-git-send-email-dgilbert@redhat.com>
Download mbox | patch
Permalink /patch/333698/
State New
Headers show

Comments

Dave Gilbert - March 25, 2014, 8:17 p.m.
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 include/migration/qemu-file.h |  4 ++++
 qemu-file.c                   | 12 ++++++++++++
 2 files changed, 16 insertions(+)

Patch

diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index f066801..e36c03f 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -174,6 +174,10 @@  int qemu_file_get_error(QEMUFile *f);
 void qemu_file_set_error(QEMUFile *f, int ret);
 void qemu_fflush(QEMUFile *f);
 
+/* TRANSITION ONLY - DON'T USE! */
+Visitor *qemu_file_get_tmp_visitor(QEMUFile *f);
+void qemu_file_set_tmp_visitor(QEMUFile *f, Visitor *v);
+
 static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv)
 {
     qemu_put_be64(f, *pv);
diff --git a/qemu-file.c b/qemu-file.c
index b1b1a5b..feb3e68 100644
--- a/qemu-file.c
+++ b/qemu-file.c
@@ -25,6 +25,8 @@  struct QEMUFile {
     unsigned int iovcnt;
 
     int last_error;
+
+    Visitor *tmp_visitor;
 };
 
 typedef struct QEMUFileStdio {
@@ -37,6 +39,16 @@  typedef struct QEMUFileSocket {
     QEMUFile *file;
 } QEMUFileSocket;
 
+Visitor *qemu_file_get_tmp_visitor(QEMUFile *f)
+{
+    return f->tmp_visitor;
+}
+
+void qemu_file_set_tmp_visitor(QEMUFile *f, Visitor *v)
+{
+    f->tmp_visitor = v;
+}
+
 static ssize_t socket_writev_buffer(void *opaque, struct iovec *iov, int iovcnt,
                                     int64_t pos)
 {