mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
migration: qemu_file_total_transferred() function is monotonic
So delta_bytes can only be greater or equal to zero. Never negative. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230504113841.23130-3-quintela@redhat.com>
This commit is contained in:
parent
520333490a
commit
f3030d3440
1 changed files with 1 additions and 7 deletions
|
@ -801,13 +801,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
|
||||||
|
|
||||||
qemu_put_be64(f, BLK_MIG_FLAG_EOS);
|
qemu_put_be64(f, BLK_MIG_FLAG_EOS);
|
||||||
delta_bytes = qemu_file_total_transferred(f) - last_bytes;
|
delta_bytes = qemu_file_total_transferred(f) - last_bytes;
|
||||||
if (delta_bytes > 0) {
|
return (delta_bytes > 0);
|
||||||
return 1;
|
|
||||||
} else if (delta_bytes < 0) {
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called with iothread lock taken. */
|
/* Called with iothread lock taken. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue