aboutsummaryrefslogtreecommitdiff
path: root/migration/savevm.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/savevm.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/savevm.c')
-rw-r--r--migration/savevm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index d907689..75d05f1 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -916,9 +916,9 @@ static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se,
{
int64_t old_offset, size;
- old_offset = qemu_ftell_fast(f);
+ old_offset = qemu_file_total_transferred_fast(f);
se->ops->save_state(f, se->opaque);
- size = qemu_ftell_fast(f) - old_offset;
+ size = qemu_file_total_transferred_fast(f) - old_offset;
if (vmdesc) {
json_writer_int64(vmdesc, "size", size);
@@ -2887,7 +2887,7 @@ bool save_snapshot(const char *name, bool overwrite, const char *vmstate,
goto the_end;
}
ret = qemu_savevm_state(f, errp);
- vm_state_size = qemu_ftell(f);
+ vm_state_size = qemu_file_total_transferred(f);
ret2 = qemu_fclose(f);
if (ret < 0) {
goto the_end;