qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] migration: fix applying wrong capabilities
Date: Tue, 6 Mar 2018 20:08:37 +0000	[thread overview]
Message-ID: <20180306200837.GQ3096@work-vm> (raw)
In-Reply-To: <20180305094938.31374-1-peterx@redhat.com>

* Peter Xu (peterx@redhat.com) wrote:
> When setting migration capabilities via QMP/HMP, we'll apply them even
> if the capability check failed.  Fix it.
> 
> Fixes: 4a84214ebe ("migration: provide migrate_caps_check()", 2017-07-18)
> Signed-off-by: Peter Xu <peterx@redhat.com>

OK, yes, that works, so:


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


It is a little odd in a way; 'caps_check' you might expect only checked
and didn't change anything.   migrate_params is organised a bit
differently; and somewhat more confusingly.

Dave

> ---
>  migration/migration.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/migration/migration.c b/migration/migration.c
> index 0aa596f867..88ed9375aa 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -747,13 +747,15 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
>  {
>      MigrationState *s = migrate_get_current();
>      MigrationCapabilityStatusList *cap;
> +    bool cap_list[MIGRATION_CAPABILITY__MAX];
>  
>      if (migration_is_setup_or_active(s->state)) {
>          error_setg(errp, QERR_MIGRATION_ACTIVE);
>          return;
>      }
>  
> -    if (!migrate_caps_check(s->enabled_capabilities, params, errp)) {
> +    memcpy(cap_list, s->enabled_capabilities, sizeof(cap_list));
> +    if (!migrate_caps_check(cap_list, params, errp)) {
>          return;
>      }
>  
> -- 
> 2.14.3
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2018-03-06 20:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-05  9:49 [Qemu-devel] [PATCH] migration: fix applying wrong capabilities Peter Xu
2018-03-06 20:08 ` Dr. David Alan Gilbert [this message]
2018-03-07  3:28   ` Peter Xu
2018-03-09 15:08 ` Dr. David Alan Gilbert

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=20180306200837.GQ3096@work-vm \
    --to=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@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).