diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-04-27 11:04:58 +0100 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2016-05-26 11:31:24 +0530 |
commit | a9cfeb33bb23a8104eeeac5769165476cbf13fe3 (patch) | |
tree | 634d79f31ad451767eeba0c928924e64d8db195f /include/migration | |
parent | 9e4d2b98ee98f4cee50d671e500eceeefa751ee0 (diff) |
migration: introduce a new QEMUFile impl based on QIOChannel
Introduce a new QEMUFile implementation that is based on
the QIOChannel objects. This impl is different from existing
impls in that there is no file descriptor that can be made
available, as some channels may be based on higher level
protocols such as TLS.
Although the QIOChannel based implementation can trivially
provide a bi-directional stream, initially we have separate
functions for opening input & output directions to fit with
the expectation of the current QEMUFile interface.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1461751518-12128-9-git-send-email-berrange@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'include/migration')
-rw-r--r-- | include/migration/qemu-file.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index 2dea81f21e..0329cccf1d 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -23,7 +23,9 @@ */ #ifndef QEMU_FILE_H #define QEMU_FILE_H 1 +#include "qemu-common.h" #include "exec/cpu-common.h" +#include "io/channel.h" /* This function writes a chunk of data to a file at the given position. @@ -135,6 +137,8 @@ QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops); QEMUFile *qemu_fopen(const char *filename, const char *mode); QEMUFile *qemu_fdopen(int fd, const char *mode); QEMUFile *qemu_fopen_socket(int fd, const char *mode); +QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc); +QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc); QEMUFile *qemu_popen_cmd(const char *command, const char *mode); QEMUFile *qemu_bufopen(const char *mode, QEMUSizedBuffer *input); void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks); |