[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/21] qemu-file: Account for rate_limit usage on qemu_fflush()
From: |
Juan Quintela |
Subject: |
[PATCH 09/21] qemu-file: Account for rate_limit usage on qemu_fflush() |
Date: |
Mon, 8 May 2023 15:08:57 +0200 |
That is the moment we know we have transferred something.
Signed-off-by: Juan Quintela <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 6ebc2bd3ec..8de1ecd082 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -301,7 +301,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);
@@ -518,7 +520,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);
}
@@ -536,7 +537,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;
@@ -553,7 +553,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.0
- Re: [PATCH 10/21] migration: Move rate_limit_max and rate_limit_used to migration_stats, (continued)
[PATCH 07/21] migration: Correct transferred bytes value, Juan Quintela, 2023/05/08
[PATCH 08/21] migration: Move setup_time to mig_stats, Juan Quintela, 2023/05/08
[PATCH 09/21] qemu-file: Account for rate_limit usage on qemu_fflush(),
Juan Quintela <=
[PATCH 11/21] migration: Move migration_total_bytes() to migration-stats.c, Juan Quintela, 2023/05/08
[PATCH 15/21] migration: Don't abuse qemu_file transferred for RDMA, Juan Quintela, 2023/05/08
[PATCH 18/21] migration/rdma: Don't use imaginary transfers, Juan Quintela, 2023/05/08
[PATCH 12/21] migration: Add a trace for migration_transferred_bytes, Juan Quintela, 2023/05/08
[PATCH 13/21] migration: Use migration_transferred_bytes() to calculate rate_limit, Juan Quintela, 2023/05/08
[PATCH 19/21] migration: Remove unused qemu_file_credit_transfer(), Juan Quintela, 2023/05/08