All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH] migration: current_migration is never NULL
Date: Fri, 19 Jul 2019 16:10:02 +0100	[thread overview]
Message-ID: <20190719151002.GC3000@work-vm> (raw)
In-Reply-To: <20190626004211.4822-1-richardw.yang@linux.intel.com>

* Wei Yang (richardw.yang@linux.intel.com) wrote:
> migration_object_init() create and assign current_migration, which means
> it will never be null until migration_shutdown().
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
>  migration/migration.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/migration/migration.c b/migration/migration.c
> index 0fd2364961..43fd8297ef 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1667,10 +1667,6 @@ bool migration_is_idle(void)
>  {
>      MigrationState *s = current_migration;
>  
> -    if (!s) {
> -        return true;
> -    }
> -

I'd prefer to keep that because it's used by migrate_add_blocker
and without this check it means we'd only be able to add a blocker
after the migration object init - which is probably fine but we
would have to check all the cases and make sure no one breaks it in
the future;  where as this check makes it just work and we don't
need to worry about the order.

Dave

>      switch (s->state) {
>      case MIGRATION_STATUS_NONE:
>      case MIGRATION_STATUS_CANCELLED:
> -- 
> 2.19.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


  reply	other threads:[~2019-07-19 15:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  0:42 [Qemu-devel] [PATCH] migration: current_migration is never NULL Wei Yang
2019-07-19 15:10 ` Dr. David Alan Gilbert [this message]
2019-07-20  1:37   ` Wei Yang

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=20190719151002.GC3000@work-vm \
    --to=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richardw.yang@linux.intel.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.