diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2013-02-12 10:37:14 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-12 16:26:44 -0600 |
commit | ad55ab42d494c5f4ebc5199c5c9db473b7d5fbf9 (patch) | |
tree | dfd4bec5aa01431745dac36de8186c908a1f5416 /include/migration | |
parent | 4a0e6714b06453078e02029e1432fab052927691 (diff) | |
download | qemu-ad55ab42d494c5f4ebc5199c5c9db473b7d5fbf9.tar.gz qemu-ad55ab42d494c5f4ebc5199c5c9db473b7d5fbf9.tar.bz2 qemu-ad55ab42d494c5f4ebc5199c5c9db473b7d5fbf9.zip |
migration: make qemu_ftell() public and support writable files
Migration .save_live_iterate() functions return the number of bytes
transferred. The easiest way of doing this is by calling qemu_ftell(f)
at the beginning and end of the function to calculate the difference.
Make qemu_ftell() public so that block-migration will be able to use it.
Also adjust the ftell calculation for writable files where buf_offset
does not include buf_size.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-id: 1360661835-28663-2-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/migration')
-rw-r--r-- | include/migration/qemu-file.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index 68deefbcfb..46fc11dc99 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -81,6 +81,7 @@ QEMUFile *qemu_popen(FILE *popen_file, const char *mode); QEMUFile *qemu_popen_cmd(const char *command, const char *mode); int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); +int64_t qemu_ftell(QEMUFile *f); void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size); void qemu_put_byte(QEMUFile *f, int v); |