From: Wei Yang <richardw.yang@linux.intel.com>
To: Ivan Ren <renyime@gmail.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] migration: add qemu_file_update_rate_transfer interface
Date: Mon, 29 Jul 2019 14:38:36 +0800 [thread overview]
Message-ID: <20190729063836.GA21091@richard> (raw)
In-Reply-To: <1564367573-6327-2-git-send-email-ivanren@tencent.com>
On Mon, Jul 29, 2019 at 10:32:52AM +0800, Ivan Ren wrote:
>Add qemu_file_update_rate_transfer for just update bytes_xfer for
>speed limitation. This will be used for further migration feature
>such as multifd migration.
>
>Signed-off-by: Ivan Ren <ivanren@tencent.com>
>---
> migration/qemu-file.c | 5 +++++
> migration/qemu-file.h | 1 +
> 2 files changed, 6 insertions(+)
>
>diff --git a/migration/qemu-file.c b/migration/qemu-file.c
>index 0431585502..13e7f03f9b 100644
>--- a/migration/qemu-file.c
>+++ b/migration/qemu-file.c
>@@ -615,6 +615,11 @@ void qemu_file_reset_rate_limit(QEMUFile *f)
> f->bytes_xfer = 0;
> }
>
>+void qemu_file_update_rate_transfer(QEMUFile *f, int64_t len)
Looks good, except the function name. Not good at naming :-)
Reviewed-by: Wei Yang <richardw.yang@linux.intel.com>
>+{
>+ f->bytes_xfer += len;
>+}
>+
> void qemu_put_be16(QEMUFile *f, unsigned int v)
> {
> qemu_put_byte(f, v >> 8);
>diff --git a/migration/qemu-file.h b/migration/qemu-file.h
>index 13baf896bd..6145d10aca 100644
>--- a/migration/qemu-file.h
>+++ b/migration/qemu-file.h
>@@ -147,6 +147,7 @@ int qemu_peek_byte(QEMUFile *f, int offset);
> void qemu_file_skip(QEMUFile *f, int size);
> void qemu_update_position(QEMUFile *f, size_t size);
> void qemu_file_reset_rate_limit(QEMUFile *f);
>+void qemu_file_update_rate_transfer(QEMUFile *f, int64_t len);
> void qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate);
> int64_t qemu_file_get_rate_limit(QEMUFile *f);
> void qemu_file_set_error(QEMUFile *f, int ret);
>--
>2.17.2 (Apple Git-113)
>
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2019-07-29 6:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 2:32 [Qemu-devel] [PATCH 0/2] add speed limit for multifd migration Ivan Ren
2019-07-29 2:32 ` [Qemu-devel] [PATCH 1/2] migration: add qemu_file_update_rate_transfer interface Ivan Ren
2019-07-29 6:38 ` Wei Yang [this message]
2019-07-29 2:32 ` [Qemu-devel] [PATCH 2/2] migration: add speed limit for multifd migration Ivan Ren
2019-07-29 6:40 ` Wei Yang
2019-07-29 6:52 ` Ivan Ren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190729063836.GA21091@richard \
--to=richardw.yang@linux.intel.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=renyime@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.