[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/20] migration: migration_transferred_bytes() don't need the
From: |
Juan Quintela |
Subject: |
[PATCH v2 10/20] migration: migration_transferred_bytes() don't need the QEMUFile |
Date: |
Tue, 30 May 2023 20:39:31 +0200 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration-stats.h | 4 +---
migration/migration-stats.c | 6 +++---
migration/migration.c | 6 +++---
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/migration/migration-stats.h b/migration/migration-stats.h
index b7795e7914..e3863bf9bb 100644
--- a/migration/migration-stats.h
+++ b/migration/migration-stats.h
@@ -137,11 +137,9 @@ void migration_rate_set(uint64_t new_rate);
/**
* migration_transferred_bytes: Return number of bytes transferred
*
- * @f: QEMUFile used for main migration channel
- *
* Returns how many bytes have we transferred since the beginning of
* the migration. It accounts for bytes sent through any migration
* channel, multifd, qemu_file, rdma, ....
*/
-uint64_t migration_transferred_bytes(QEMUFile *f);
+uint64_t migration_transferred_bytes(void);
#endif
diff --git a/migration/migration-stats.c b/migration/migration-stats.c
index 1696185694..a5f3fcc5ae 100644
--- a/migration/migration-stats.c
+++ b/migration/migration-stats.c
@@ -25,7 +25,7 @@ bool migration_rate_exceeded(QEMUFile *f)
}
uint64_t rate_limit_start = stat64_get(&mig_stats.rate_limit_start);
- uint64_t rate_limit_current = migration_transferred_bytes(f);
+ uint64_t rate_limit_current = migration_transferred_bytes();
uint64_t rate_limit_used = rate_limit_current - rate_limit_start;
uint64_t rate_limit_max = stat64_get(&mig_stats.rate_limit_max);
@@ -55,10 +55,10 @@ void migration_rate_set(uint64_t limit)
void migration_rate_reset(QEMUFile *f)
{
- stat64_set(&mig_stats.rate_limit_start, migration_transferred_bytes(f));
+ stat64_set(&mig_stats.rate_limit_start, migration_transferred_bytes());
}
-uint64_t migration_transferred_bytes(QEMUFile *f)
+uint64_t migration_transferred_bytes(void)
{
uint64_t multifd = stat64_get(&mig_stats.multifd_bytes);
uint64_t rdma = stat64_get(&mig_stats.rdma_bytes);
diff --git a/migration/migration.c b/migration/migration.c
index 31d30a2ac5..24e55c5bf3 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2628,7 +2628,7 @@ static MigThrError migration_detect_error(MigrationState
*s)
static void migration_calculate_complete(MigrationState *s)
{
- uint64_t bytes = migration_transferred_bytes(s->to_dst_file);
+ uint64_t bytes = migration_transferred_bytes();
int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
int64_t transfer_time;
@@ -2654,7 +2654,7 @@ static void
update_iteration_initial_status(MigrationState *s)
* wrong speed calculation.
*/
s->iteration_start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
- s->iteration_initial_bytes = migration_transferred_bytes(s->to_dst_file);
+ s->iteration_initial_bytes = migration_transferred_bytes();
s->iteration_initial_pages = ram_get_total_transferred_pages();
}
@@ -2669,7 +2669,7 @@ static void migration_update_counters(MigrationState *s,
return;
}
- current_bytes = migration_transferred_bytes(s->to_dst_file);
+ current_bytes = migration_transferred_bytes();
transferred = current_bytes - s->iteration_initial_bytes;
time_spent = current_time - s->iteration_start_time;
bandwidth = (double)transferred / time_spent;
--
2.40.1
- [PATCH v2 00/20] Next round of migration atomic counters, Juan Quintela, 2023/05/30
- [PATCH v2 02/20] migration: Change qemu_file_transferred to noflush, Juan Quintela, 2023/05/30
- [PATCH v2 01/20] qemu-file: Rename qemu_file_transferred_ fast -> noflush, Juan Quintela, 2023/05/30
- [PATCH v2 04/20] qemu-file: We only call qemu_file_transferred_* on the sending side, Juan Quintela, 2023/05/30
- [PATCH v2 03/20] migration: Use qemu_file_transferred_noflush() for block migration., Juan Quintela, 2023/05/30
- [PATCH v2 05/20] qemu_file: Use a stat64 for qemu_file_transferred, Juan Quintela, 2023/05/30
- [PATCH v2 07/20] migration: Use the number of transferred bytes directly, Juan Quintela, 2023/05/30
- [PATCH v2 06/20] qemu_file: total_transferred is not used anymore, Juan Quintela, 2023/05/30
- [PATCH v2 08/20] qemu_file: Remove unused qemu_file_transferred(), Juan Quintela, 2023/05/30
- [PATCH v2 09/20] qemu-file: Remove _noflush from qemu_file_transferred_noflush(), Juan Quintela, 2023/05/30
- [PATCH v2 10/20] migration: migration_transferred_bytes() don't need the QEMUFile,
Juan Quintela <=
- [PATCH v2 11/20] migration: migration_rate_limit_reset() don't need the QEMUFile, Juan Quintela, 2023/05/30
- [PATCH v2 13/20] migration: Use migration_transferred_bytes(), Juan Quintela, 2023/05/30
- [PATCH v2 12/20] qemu-file: Simplify qemu_file_get_error(), Juan Quintela, 2023/05/30
- [PATCH v2 14/20] migration: Remove transferred atomic counter, Juan Quintela, 2023/05/30
- [PATCH v2 15/20] qemu-file: Make qemu_fflush() return errors, Juan Quintela, 2023/05/30
- [PATCH v2 18/20] qemu_file: Make qemu_file_is_writable() static, Juan Quintela, 2023/05/30
- [PATCH v2 19/20] qemu-file: Simplify qemu_file_shutdown(), Juan Quintela, 2023/05/30
- [PATCH v2 20/20] qemu-file: Make qemu_file_get_error_obj() static, Juan Quintela, 2023/05/30
- [PATCH v2 16/20] migration/rdma: Split qemu_fopen_rdma() into input/output functions, Juan Quintela, 2023/05/30
- [PATCH v2 17/20] qemu-file: Remove unused qemu_file_mode_is_not_valid(), Juan Quintela, 2023/05/30