[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/9] qemu-file: make qemu_file_[sg]et_rate_limit() use an uin
From: |
Juan Quintela |
Subject: |
Re: [PATCH 3/9] qemu-file: make qemu_file_[sg]et_rate_limit() use an uint64_t |
Date: |
Fri, 05 May 2023 01:59:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Juan Quintela <quintela@redhat.com> wrote:
> It is really size_t. Everything else uses uint64_t, so move this to
> uint64_t as well. A size can't be negative anyways.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
Self-nack.
> - qemu_file_set_rate_limit(ms->to_dst_file, INT64_MAX);
> + qemu_file_set_rate_limit(ms->to_dst_file, UINT64_MAX);
1st: this should be zero.
> } else {
> qemu_file_set_rate_limit(ms->to_dst_file, bandwidth /
> XFER_LIMIT_RATIO);
> }
> @@ -2301,7 +2301,7 @@ static void migration_completion(MigrationState *s)
> }
> if (ret >= 0) {
> s->block_inactive = !migrate_colo();
> - qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX);
> + qemu_file_set_rate_limit(s->to_dst_file, UINT64_MAX);
Same here
> ret = qemu_savevm_state_complete_precopy(s->to_dst_file,
> false,
> s->block_inactive);
> }
> @@ -3049,7 +3049,7 @@ static void *bg_migration_thread(void *opaque)
> rcu_register_thread();
> object_ref(OBJECT(s));
>
> - qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX);
> + qemu_file_set_rate_limit(s->to_dst_file, UINT64_MAX);
And here.
> @@ -748,18 +748,18 @@ int qemu_file_rate_limit(QEMUFile *f)
> if (qemu_file_get_error(f)) {
> return 1;
> }
> - if (f->rate_limit_max > 0 && f->rate_limit_used > f->rate_limit_max) {
> + if (f->rate_limit_used > f->rate_limit_max) {
And this is wrong. f->rate_limit_max == 0 means that we don't do rate_limit.
Will resend this one later.
Sorry, Juan.
PD. No, I have no clue how I have had this patch applied the whole day
and no failures and now I get failures in migration-test. The
number of times that I run this test on the last two days have been
in the hundreds.
- Re: [PATCH 7/9] qemu-file: Make total_transferred an uint64_t, (continued)
[PATCH 3/9] qemu-file: make qemu_file_[sg]et_rate_limit() use an uint64_t, Juan Quintela, 2023/05/04
Re: [PATCH 0/9] QEMU file cleanups, Peter Xu, 2023/05/04