[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/9] migration: qemu_file_total_transferred() function is monoton
From: |
Juan Quintela |
Subject: |
[PATCH 2/9] migration: qemu_file_total_transferred() function is monotonic |
Date: |
Thu, 4 May 2023 13:38:34 +0200 |
So delta_bytes can only be greater or equal to zero. Never negative.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/block.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/migration/block.c b/migration/block.c
index 6d532ac7a2..3499f75e37 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -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. */
--
2.40.0
- [PATCH 0/9] QEMU file cleanups, Juan Quintela, 2023/05/04
- [PATCH 1/9] migration: max_postcopy_bandwidth is a size parameter, Juan Quintela, 2023/05/04
- [PATCH 2/9] migration: qemu_file_total_transferred() function is monotonic,
Juan Quintela <=
- [PATCH 4/9] qemu-file: Make rate_limit_used an uint64_t, Juan Quintela, 2023/05/04
- [PATCH 5/9] qemu-file: No need to check for shutdown in qemu_file_rate_limit, Juan Quintela, 2023/05/04
- [PATCH 6/9] qemu-file: remove shutdown member, Juan Quintela, 2023/05/04
- [PATCH 8/9] qemu-file: Make ram_control_save_page() use accessors for rate_limit, Juan Quintela, 2023/05/04