aboutsummaryrefslogtreecommitdiff
path: root/qemu-file.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-08 10:15:15 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-11-02 18:34:59 +0100
commit9229bf3c2d7afcd1adce7258843d9bc82b066b08 (patch)
tree1fe8611ff775fd8ab4838e5b88dcc6dde0397553 /qemu-file.h
parent5f0ebf1b4d58be0c0bb05beb195b6f42942eeee8 (diff)
migration: consolidate QEMUFile methods in a single QEMUFileOps struct
Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-file.h')
-rw-r--r--qemu-file.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/qemu-file.h b/qemu-file.h
index 9c8985b610..c89e8e09dc 100644
--- a/qemu-file.h
+++ b/qemu-file.h
@@ -59,12 +59,16 @@ typedef int (QEMUFileRateLimit)(void *opaque);
typedef int64_t (QEMUFileSetRateLimit)(void *opaque, int64_t new_rate);
typedef int64_t (QEMUFileGetRateLimit)(void *opaque);
-QEMUFile *qemu_fopen_ops(void *opaque, QEMUFilePutBufferFunc *put_buffer,
- QEMUFileGetBufferFunc *get_buffer,
- QEMUFileCloseFunc *close,
- QEMUFileRateLimit *rate_limit,
- QEMUFileSetRateLimit *set_rate_limit,
- QEMUFileGetRateLimit *get_rate_limit);
+typedef struct QEMUFileOps {
+ QEMUFilePutBufferFunc *put_buffer;
+ QEMUFileGetBufferFunc *get_buffer;
+ QEMUFileCloseFunc *close;
+ QEMUFileRateLimit *rate_limit;
+ QEMUFileSetRateLimit *set_rate_limit;
+ QEMUFileGetRateLimit *get_rate_limit;
+} QEMUFileOps;
+
+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);