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:
Juan Quintela 2023-05-04 13:38:34 +02:00
parent 520333490a
commit f3030d3440

View File

@ -801,13 +801,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;
if (delta_bytes > 0) {
return 1;
} else if (delta_bytes < 0) {
return -1;
} else {
return 0;
}
return (delta_bytes > 0);
}
/* Called with iothread lock taken. */