From a9cfeb33bb23a8104eeeac5769165476cbf13fe3 Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange Date: Wed, 27 Apr 2016 11:04:58 +0100 Subject: 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 Signed-off-by: Daniel P. Berrange Message-Id: <1461751518-12128-9-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah --- include/migration/qemu-file.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/migration') 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); -- cgit v1.2.3-55-g7522