[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/12] qemu-file: Account for rate_limit usage on qemu_fflush()
From: |
Juan Quintela |
Subject: |
[PULL 05/12] qemu-file: Account for rate_limit usage on qemu_fflush() |
Date: |
Thu, 18 May 2023 19:12:57 +0200 |
That is the moment we know we have transferred something.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20230515195709.63843-5-quintela@redhat.com>
---
migration/qemu-file.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 9728002de5..3d66c5c512 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -302,7 +302,9 @@ void qemu_fflush(QEMUFile *f)
&local_error) < 0) {
qemu_file_set_error_obj(f, -EIO, local_error);
} else {
- f->total_transferred += iov_size(f->iov, f->iovcnt);
+ uint64_t size = iov_size(f->iov, f->iovcnt);
+ qemu_file_acct_rate_limit(f, size);
+ f->total_transferred += size;
}
qemu_iovec_release_ram(f);
@@ -519,7 +521,6 @@ void qemu_put_buffer_async(QEMUFile *f, const uint8_t *buf,
size_t size,
return;
}
- f->rate_limit_used += size;
add_to_iovec(f, buf, size, may_free);
}
@@ -537,7 +538,6 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf,
size_t size)
l = size;
}
memcpy(f->buf + f->buf_index, buf, l);
- f->rate_limit_used += l;
add_buf_to_iovec(f, l);
if (qemu_file_get_error(f)) {
break;
@@ -554,7 +554,6 @@ void qemu_put_byte(QEMUFile *f, int v)
}
f->buf[f->buf_index] = v;
- f->rate_limit_used++;
add_buf_to_iovec(f, 1);
}
--
2.40.1
- [PULL 00/12] Migration 20230518 patches, Juan Quintela, 2023/05/18
- [PULL 01/12] configure: add --disable-colo-proxy option, Juan Quintela, 2023/05/18
- [PULL 02/12] migration: split migration_incoming_co, Juan Quintela, 2023/05/18
- [PULL 03/12] migration: process_incoming_migration_co(): move colo part to colo, Juan Quintela, 2023/05/18
- [PULL 04/12] migration: Don't use INT64_MAX for unlimited rate, Juan Quintela, 2023/05/18
- [PULL 05/12] qemu-file: Account for rate_limit usage on qemu_fflush(),
Juan Quintela <=
- [PULL 06/12] migration: Move rate_limit_max and rate_limit_used to migration_stats, Juan Quintela, 2023/05/18
- [PULL 07/12] migration: Move migration_total_bytes() to migration-stats.c, Juan Quintela, 2023/05/18
- [PULL 08/12] migration: Add a trace for migration_transferred_bytes, Juan Quintela, 2023/05/18
- [PULL 09/12] migration: Use migration_transferred_bytes() to calculate rate_limit, Juan Quintela, 2023/05/18
- [PULL 11/12] migration/multifd: Compute transferred bytes correctly, Juan Quintela, 2023/05/18
- [PULL 12/12] migration: Fix duplicated included in meson.build, Juan Quintela, 2023/05/18
- [PULL 10/12] migration: We don't need the field rate_limit_used anymore, Juan Quintela, 2023/05/18