From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel <qemu-devel@nongnu.org>, Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 14/14] Rename buffered_ to migration_
Date: Tue, 15 Jan 2013 16:12:44 +0100 [thread overview]
Message-ID: <50F571EC.5060601@redhat.com> (raw)
In-Reply-To: <1358248702-14278-15-git-send-email-quintela@redhat.com>
Il 15/01/2013 12:18, Juan Quintela ha scritto:
> This is consistent once that we have moved everything to migration.c
Please drop this patch, I have the same changes later in my queue and it
causes a lot of conflicts if you put it here. It's true that the code
is migration.c, but it is still about buffering so I think the renaming
is premature.
Otherwise the series looks good, thanks!
Paolo
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
> migration.c | 38 +++++++++++++++++++-------------------
> 1 file changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/migration.c b/migration.c
> index 77c1971..ac67525 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -522,7 +522,7 @@ int64_t migrate_xbzrle_cache_size(void)
> /* migration thread support */
>
>
> -static ssize_t buffered_flush(MigrationState *s)
> +static ssize_t migration_flush(MigrationState *s)
> {
> size_t offset = 0;
> ssize_t ret = 0;
> @@ -552,7 +552,7 @@ static ssize_t buffered_flush(MigrationState *s)
> return offset;
> }
>
> -static int buffered_put_buffer(void *opaque, const uint8_t *buf,
> +static int migration_put_buffer(void *opaque, const uint8_t *buf,
> int64_t pos, int size)
> {
> MigrationState *s = opaque;
> @@ -585,7 +585,7 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf,
> return size;
> }
>
> -static int buffered_close(void *opaque)
> +static int migration_close(void *opaque)
> {
> MigrationState *s = opaque;
> ssize_t ret = 0;
> @@ -595,7 +595,7 @@ static int buffered_close(void *opaque)
>
> s->xfer_limit = INT_MAX;
> while (!qemu_file_get_error(s->file) && s->buffer_size) {
> - ret = buffered_flush(s);
> + ret = migration_flush(s);
> if (ret < 0) {
> break;
> }
> @@ -609,7 +609,7 @@ static int buffered_close(void *opaque)
> return ret;
> }
>
> -static int buffered_get_fd(void *opaque)
> +static int migration_get_fd(void *opaque)
> {
> MigrationState *s = opaque;
>
> @@ -622,7 +622,7 @@ static int buffered_get_fd(void *opaque)
> * 1: Time to stop
> * negative: There has been an error
> */
> -static int buffered_rate_limit(void *opaque)
> +static int migration_rate_limit(void *opaque)
> {
> MigrationState *s = opaque;
> int ret;
> @@ -639,7 +639,7 @@ static int buffered_rate_limit(void *opaque)
> return 0;
> }
>
> -static int64_t buffered_set_rate_limit(void *opaque, int64_t new_rate)
> +static int64_t migration_set_rate_limit(void *opaque, int64_t new_rate)
> {
> MigrationState *s = opaque;
> if (qemu_file_get_error(s->file)) {
> @@ -655,14 +655,14 @@ out:
> return s->xfer_limit;
> }
>
> -static int64_t buffered_get_rate_limit(void *opaque)
> +static int64_t migration_get_rate_limit(void *opaque)
> {
> MigrationState *s = opaque;
>
> return s->xfer_limit;
> }
>
> -static void *buffered_file_thread(void *opaque)
> +static void *migration_file_thread(void *opaque)
> {
> MigrationState *s = opaque;
> int64_t initial_time = qemu_get_clock_ms(rt_clock);
> @@ -752,7 +752,7 @@ static void *buffered_file_thread(void *opaque)
> /* usleep expects microseconds */
> g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
> }
> - ret = buffered_flush(s);
> + ret = migration_flush(s);
> if (ret < 0) {
> break;
> }
> @@ -766,13 +766,13 @@ out:
> return NULL;
> }
>
> -static const QEMUFileOps buffered_file_ops = {
> - .get_fd = buffered_get_fd,
> - .put_buffer = buffered_put_buffer,
> - .close = buffered_close,
> - .rate_limit = buffered_rate_limit,
> - .get_rate_limit = buffered_get_rate_limit,
> - .set_rate_limit = buffered_set_rate_limit,
> +static const QEMUFileOps migration_file_ops = {
> + .get_fd = migration_get_fd,
> + .put_buffer = migration_put_buffer,
> + .close = migration_close,
> + .rate_limit = migration_rate_limit,
> + .get_rate_limit = migration_get_rate_limit,
> + .set_rate_limit = migration_set_rate_limit,
> };
>
> void migrate_fd_connect(MigrationState *s)
> @@ -786,9 +786,9 @@ void migrate_fd_connect(MigrationState *s)
> s->xfer_limit = s->bandwidth_limit / XFER_LIMIT_RATIO;
> s->complete = false;
>
> - s->file = qemu_fopen_ops(s, &buffered_file_ops);
> + s->file = qemu_fopen_ops(s, &migration_file_ops);
>
> - qemu_thread_create(&s->thread, buffered_file_thread, s,
> + qemu_thread_create(&s->thread, migration_file_thread, s,
> QEMU_THREAD_DETACHED);
> notifier_list_notify(&migration_state_notifiers, s);
> }
>
next prev parent reply other threads:[~2013-01-15 15:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 11:18 [Qemu-devel] [PATCH 00/14] migration queue Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 01/14] Unlock ramlist lock also in error case Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 02/14] Protect migration_bitmap_sync() with the ramlist lock Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 03/14] use XFER_LIMIT_RATIO consistently Juan Quintela
2013-01-15 19:45 ` Eric Blake
2013-01-15 11:18 ` [Qemu-devel] [PATCH 04/14] migration: make function static Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 05/14] migration: remove double call to migrate_fd_close Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 06/14] migration: fix off-by-one in buffered_rate_limit Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 07/14] qemu-file: Only set last_error if it is not already set Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 08/14] migration: move begining stage to the migration thread Juan Quintela
2013-01-15 19:47 ` Eric Blake
2013-01-15 11:18 ` [Qemu-devel] [PATCH 09/14] migration: Add buffered_flush error handling Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 10/14] migration: move exit condition to migration thread Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 11/14] migration: unfold rest of migrate_fd_put_ready() into thread Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 12/14] migration: Only go to the iterate stage if there is anything to send Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 13/14] migration: remove argument to qemu_savevm_state_cancel Juan Quintela
2013-01-15 11:18 ` [Qemu-devel] [PATCH 14/14] Rename buffered_ to migration_ Juan Quintela
2013-01-15 15:12 ` Paolo Bonzini [this message]
2013-01-15 19:50 ` [Qemu-devel] [PATCH 00/14] migration queue Eric Blake
2013-01-16 18:14 ` Anthony Liguori
2013-01-17 10:50 ` Paolo Bonzini
2013-01-17 12:46 ` Juan Quintela
2013-01-17 13:00 ` Paolo Bonzini
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=50F571EC.5060601@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).