qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] migration: Make events a capability
Date: Tue, 7 Jul 2015 14:07:50 +0100	[thread overview]
Message-ID: <20150707130750.GE2347@work-vm> (raw)
In-Reply-To: <1436273249-20966-1-git-send-email-quintela@redhat.com>

* Juan Quintela (quintela@redhat.com) wrote:
> Make check fails with events.  THis is due to the parser/lexer that it
> uses.  Just in case that they are more broken parsers, just only send
> events when there are capabilities.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  include/migration/migration.h |  1 +
>  migration/migration.c         | 20 ++++++++++++++++++--
>  qapi-schema.json              |  5 ++++-
>  3 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/include/migration/migration.h b/include/migration/migration.h
> index a308ecc..b2711ef 100644
> --- a/include/migration/migration.h
> +++ b/include/migration/migration.h
> @@ -177,6 +177,7 @@ bool migrate_use_compression(void);
>  int migrate_compress_level(void);
>  int migrate_compress_threads(void);
>  int migrate_decompress_threads(void);
> +bool migrate_use_events(void);
> 
>  void ram_control_before_iterate(QEMUFile *f, uint64_t flags);
>  void ram_control_after_iterate(QEMUFile *f, uint64_t flags);
> diff --git a/migration/migration.c b/migration/migration.c
> index d00a33b..45719a0 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -205,6 +205,14 @@ void register_global_state(void)
>      vmstate_register(NULL, 0, &vmstate_globalstate, &global_state);
>  }
> 
> +static void migrate_generate_event(int new_state)
> +{
> +    if (migrate_use_events()) {
> +        qapi_event_send_migration(new_state, &error_abort);
> +        trace_migrate_set_state(new_state);
> +    }
> +}
> +

OK, I would have traced it anyway, but not worth holding it up for that.

Dave

>  /*
>   * Called on -incoming with a defer: uri.
>   * The migration can be started later after any parameters have been
> @@ -514,8 +522,7 @@ void qmp_migrate_set_parameters(bool has_compress_level,
>  static void migrate_set_state(MigrationState *s, int old_state, int new_state)
>  {
>      if (atomic_cmpxchg(&s->state, old_state, new_state) == old_state) {
> -        qapi_event_send_migration(new_state, &error_abort);
> -        trace_migrate_set_state(new_state);
> +        migrate_generate_event(new_state);
>      }
>  }
> 
> @@ -865,6 +872,15 @@ int migrate_decompress_threads(void)
>      return s->parameters[MIGRATION_PARAMETER_DECOMPRESS_THREADS];
>  }
> 
> +bool migrate_use_events(void)
> +{
> +    MigrationState *s;
> +
> +    s = migrate_get_current();
> +
> +    return s->enabled_capabilities[MIGRATION_CAPABILITY_EVENTS];
> +}
> +
>  int migrate_use_xbzrle(void)
>  {
>      MigrationState *s;
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 106008c..1285b8c 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -523,6 +523,9 @@
>  #          minimize migration traffic. The feature is disabled by default.
>  #          (since 2.4 )
>  #
> +# @events: generate events for each migration state change
> +#          (since 2.4 )
> +#
>  # @auto-converge: If enabled, QEMU will automatically throttle down the guest
>  #          to speed up convergence of RAM migration. (since 1.6)
>  #
> @@ -530,7 +533,7 @@
>  ##
>  { 'enum': 'MigrationCapability',
>    'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
> -           'compress'] }
> +           'compress', 'events'] }
> 
>  ##
>  # @MigrationCapabilityStatus
> -- 
> 2.4.3
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2015-07-07 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 12:47 [Qemu-devel] [PATCH] migration: Make events a capability Juan Quintela
2015-07-07 13:07 ` Dr. David Alan Gilbert [this message]
2015-08-03 19:43 ` Eric Blake

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=20150707130750.GE2347@work-vm \
    --to=dgilbert@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).