diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-04-27 11:04:55 +0100 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2016-05-26 11:31:16 +0530 |
commit | 0436e09f9654dfa6f7439531bf443b1f78870ed6 (patch) | |
tree | b17129a565c93377b71d71fc3e3221e0b26e8a4a /include/migration | |
parent | baf51e7739a4d176284d2e38e1755afeafcd2ee0 (diff) |
migration: split migration hooks out of QEMUFileOps
The QEMUFileOps struct contains the I/O subsystem callbacks
and the migration stage hooks. Split the hooks out into a
separate QEMUFileHooks struct to make it easier to refactor
the I/O side of QEMUFile without affecting the hooks.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <1461751518-12128-6-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 | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index 5909ff06f0..1934a64a64 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -108,13 +108,16 @@ typedef struct QEMUFileOps { QEMUFileCloseFunc *close; QEMUFileGetFD *get_fd; QEMUFileWritevBufferFunc *writev_buffer; + QEMURetPathFunc *get_return_path; + QEMUFileShutdownFunc *shut_down; +} QEMUFileOps; + +typedef struct QEMUFileHooks { QEMURamHookFunc *before_ram_iterate; QEMURamHookFunc *after_ram_iterate; QEMURamHookFunc *hook_ram_load; QEMURamSaveFunc *save_page; - QEMURetPathFunc *get_return_path; - QEMUFileShutdownFunc *shut_down; -} QEMUFileOps; +} QEMUFileHooks; struct QEMUSizedBuffer { struct iovec *iov; @@ -129,6 +132,7 @@ QEMUFile *qemu_fdopen(int fd, const char *mode); QEMUFile *qemu_fopen_socket(int fd, const char *mode); 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); int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); int64_t qemu_ftell(QEMUFile *f); |