mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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
This commit is contained in:
parent
154d87b4ef
commit
fbfa6404e5
6 changed files with 46 additions and 15 deletions
|
@ -124,8 +124,37 @@ QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops, bool has_ioc);
|
|||
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);
|
||||
int64_t qemu_ftell_fast(QEMUFile *f);
|
||||
|
||||
/*
|
||||
* qemu_file_total_transferred:
|
||||
*
|
||||
* Report the total number of bytes transferred with
|
||||
* this file.
|
||||
*
|
||||
* For writable files, any pending buffers will be
|
||||
* flushed, so the reported value will be equal to
|
||||
* the number of bytes transferred on the wire.
|
||||
*
|
||||
* For readable files, the reported value will be
|
||||
* equal to the number of bytes transferred on the
|
||||
* wire.
|
||||
*
|
||||
* Returns: the total bytes transferred
|
||||
*/
|
||||
int64_t qemu_file_total_transferred(QEMUFile *f);
|
||||
|
||||
/*
|
||||
* qemu_file_total_transferred_fast:
|
||||
*
|
||||
* As qemu_file_total_transferred except for writable
|
||||
* files, where no flush is performed and the reported
|
||||
* amount will include the size of any queued buffers,
|
||||
* on top of the amount actually transferred.
|
||||
*
|
||||
* Returns: the total bytes transferred and queued
|
||||
*/
|
||||
int64_t qemu_file_total_transferred_fast(QEMUFile *f);
|
||||
|
||||
/*
|
||||
* put_buffer without copying the buffer.
|
||||
* The buffer should be available till it is sent asynchronously.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue