aboutsummaryrefslogtreecommitdiff
path: root/migration/block.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-06-20 12:01:50 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2022-06-22 19:33:36 +0100
commitfbfa6404e597920ad72510461e0b0fed5243ce1d (patch)
treefbeb0b70234041557ea0027f59c59f23c3222076 /migration/block.c
parent154d87b4ef7f32fe4b11357648ec0b81b7e77d59 (diff)
downloadqemu-fbfa6404e597920ad72510461e0b0fed5243ce1d.zip
qemu-fbfa6404e597920ad72510461e0b0fed5243ce1d.tar.gz
qemu-fbfa6404e597920ad72510461e0b0fed5243ce1d.tar.bz2
migration: rename qemu_ftell to qemu_file_total_transferred
The name 'ftell' gives the misleading impression that the QEMUFile objects are seekable. This is not the case, as in general we just have an opaque stream. The users of this method are only interested in the total bytes processed. This switches to a new name that reflects the intended usage. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> dgilbert: Wrapped long line
Diffstat (limited to 'migration/block.c')
-rw-r--r--migration/block.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/migration/block.c b/migration/block.c
index 077a413..823453c 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -756,8 +756,8 @@ static int block_save_setup(QEMUFile *f, void *opaque)
static int block_save_iterate(QEMUFile *f, void *opaque)
{
int ret;
- int64_t last_ftell = qemu_ftell(f);
- int64_t delta_ftell;
+ int64_t last_bytes = qemu_file_total_transferred(f);
+ int64_t delta_bytes;
trace_migration_block_save("iterate", block_mig_state.submitted,
block_mig_state.transferred);
@@ -809,10 +809,10 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
}
qemu_put_be64(f, BLK_MIG_FLAG_EOS);
- delta_ftell = qemu_ftell(f) - last_ftell;
- if (delta_ftell > 0) {
+ delta_bytes = qemu_file_total_transferred(f) - last_bytes;
+ if (delta_bytes > 0) {
return 1;
- } else if (delta_ftell < 0) {
+ } else if (delta_bytes < 0) {
return -1;
} else {
return 0;