qemu-file: Make total_transferred an uint64_t

Change all the functions that use it.  It was already passed as
uint64_t.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230504113841.23130-8-quintela@redhat.com>
This commit is contained in:
Juan Quintela 2023-05-04 13:38:39 +02:00
parent ac7d25b816
commit 61abf1ebdc
5 changed files with 11 additions and 14 deletions

View File

@ -747,8 +747,7 @@ static int block_save_setup(QEMUFile *f, void *opaque)
static int block_save_iterate(QEMUFile *f, void *opaque)
{
int ret;
int64_t last_bytes = qemu_file_total_transferred(f);
int64_t delta_bytes;
uint64_t last_bytes = qemu_file_total_transferred(f);
trace_migration_block_save("iterate", block_mig_state.submitted,
block_mig_state.transferred);
@ -800,7 +799,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
}
qemu_put_be64(f, BLK_MIG_FLAG_EOS);
delta_bytes = qemu_file_total_transferred(f) - last_bytes;
uint64_t delta_bytes = qemu_file_total_transferred(f) - last_bytes;
return (delta_bytes > 0);
}

View File

@ -51,7 +51,7 @@ struct QEMUFile {
int64_t rate_limit_used;
/* The sum of bytes transferred on the wire */
int64_t total_transferred;
uint64_t total_transferred;
int buf_index;
int buf_size; /* 0 when writing */
@ -708,9 +708,9 @@ int coroutine_mixed_fn qemu_get_byte(QEMUFile *f)
return result;
}
int64_t qemu_file_total_transferred_fast(QEMUFile *f)
uint64_t qemu_file_total_transferred_fast(QEMUFile *f)
{
int64_t ret = f->total_transferred;
uint64_t ret = f->total_transferred;
int i;
for (i = 0; i < f->iovcnt; i++) {
@ -720,7 +720,7 @@ int64_t qemu_file_total_transferred_fast(QEMUFile *f)
return ret;
}
int64_t qemu_file_total_transferred(QEMUFile *f)
uint64_t qemu_file_total_transferred(QEMUFile *f)
{
qemu_fflush(f);
return f->total_transferred;

View File

@ -83,7 +83,7 @@ int qemu_fclose(QEMUFile *f);
*
* Returns: the total bytes transferred
*/
int64_t qemu_file_total_transferred(QEMUFile *f);
uint64_t qemu_file_total_transferred(QEMUFile *f);
/*
* qemu_file_total_transferred_fast:
@ -95,7 +95,7 @@ int64_t qemu_file_total_transferred(QEMUFile *f);
*
* Returns: the total bytes transferred and queued
*/
int64_t qemu_file_total_transferred_fast(QEMUFile *f);
uint64_t qemu_file_total_transferred_fast(QEMUFile *f);
/*
* put_buffer without copying the buffer.

View File

@ -927,11 +927,9 @@ static int vmstate_load(QEMUFile *f, SaveStateEntry *se)
static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se,
JSONWriter *vmdesc)
{
int64_t old_offset, size;
old_offset = qemu_file_total_transferred_fast(f);
uint64_t old_offset = qemu_file_total_transferred_fast(f);
se->ops->save_state(f, se->opaque);
size = qemu_file_total_transferred_fast(f) - old_offset;
uint64_t size = qemu_file_total_transferred_fast(f) - old_offset;
if (vmdesc) {
json_writer_int64(vmdesc, "size", size);

View File

@ -349,7 +349,7 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
void *first_elem = opaque + field->offset;
int i, n_elems = vmstate_n_elems(opaque, field);
int size = vmstate_size(opaque, field);
int64_t old_offset, written_bytes;
uint64_t old_offset, written_bytes;
JSONWriter *vmdesc_loop = vmdesc;
trace_vmstate_save_state_loop(vmsd->name, field->name, n_elems);