aboutsummaryrefslogtreecommitdiff
path: root/migration/vmstate.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/vmstate.c
parent154d87b4ef7f32fe4b11357648ec0b81b7e77d59 (diff)
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/vmstate.c')
-rw-r--r--migration/vmstate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/migration/vmstate.c b/migration/vmstate.c
index 36ae8b9e19..924494bda3 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -360,7 +360,7 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
void *curr_elem = first_elem + size * i;
vmsd_desc_field_start(vmsd, vmdesc_loop, field, i, n_elems);
- old_offset = qemu_ftell_fast(f);
+ old_offset = qemu_file_total_transferred_fast(f);
if (field->flags & VMS_ARRAY_OF_POINTER) {
assert(curr_elem);
curr_elem = *(void **)curr_elem;
@@ -390,7 +390,8 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
return ret;
}
- written_bytes = qemu_ftell_fast(f) - old_offset;
+ written_bytes = qemu_file_total_transferred_fast(f) -
+ old_offset;
vmsd_desc_field_end(vmsd, vmdesc_loop, field, written_bytes, i);
/* Compressed arrays only care about the first element */