qemu-devel.nongnu.org archive mirror
 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 v2] migration: cleanup check on ops in savevm.handlers iterations
Date: Thu, 12 Sep 2019 10:55:43 +0100	[thread overview]
Message-ID: <20190912095543.GB7230@work-vm> (raw)
In-Reply-To: <20190819032804.8579-1-richardw.yang@linux.intel.com>

* Wei Yang (richardw.yang@linux.intel.com) wrote:
> During migration, there are several places to iterate on
> savevm.handlers. And on each iteration, we need to check its ops and
> related callbacks before invoke it.
> 
> Generally, ops is the first element to check, and it is only necessary
> to check it once.
> 
> This patch clean all the related part in savevm.c to check ops only once
> in those iterations.
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

Queued

> 
> ---
> v2: rebase on latest upstream
> ---
>  migration/savevm.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 4a86128ac4..35426d1db8 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1100,7 +1100,7 @@ void qemu_savevm_state_setup(QEMUFile *f)
>          if (!se->ops || !se->ops->save_setup) {
>              continue;
>          }
> -        if (se->ops && se->ops->is_active) {
> +        if (se->ops->is_active) {
>              if (!se->ops->is_active(se->opaque)) {
>                  continue;
>              }
> @@ -1131,7 +1131,7 @@ int qemu_savevm_state_resume_prepare(MigrationState *s)
>          if (!se->ops || !se->ops->resume_prepare) {
>              continue;
>          }
> -        if (se->ops && se->ops->is_active) {
> +        if (se->ops->is_active) {
>              if (!se->ops->is_active(se->opaque)) {
>                  continue;
>              }
> @@ -1227,7 +1227,7 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f)
>          if (!se->ops || !se->ops->save_live_complete_postcopy) {
>              continue;
>          }
> -        if (se->ops && se->ops->is_active) {
> +        if (se->ops->is_active) {
>              if (!se->ops->is_active(se->opaque)) {
>                  continue;
>              }
> @@ -1264,7 +1264,7 @@ int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy)
>              continue;
>          }
>  
> -        if (se->ops && se->ops->is_active) {
> +        if (se->ops->is_active) {
>              if (!se->ops->is_active(se->opaque)) {
>                  continue;
>              }
> @@ -1413,7 +1413,7 @@ void qemu_savevm_state_pending(QEMUFile *f, uint64_t threshold_size,
>          if (!se->ops || !se->ops->save_live_pending) {
>              continue;
>          }
> -        if (se->ops && se->ops->is_active) {
> +        if (se->ops->is_active) {
>              if (!se->ops->is_active(se->opaque)) {
>                  continue;
>              }
> @@ -2334,7 +2334,7 @@ static int qemu_loadvm_state_setup(QEMUFile *f)
>          if (!se->ops || !se->ops->load_setup) {
>              continue;
>          }
> -        if (se->ops && se->ops->is_active) {
> +        if (se->ops->is_active) {
>              if (!se->ops->is_active(se->opaque)) {
>                  continue;
>              }
> -- 
> 2.17.1
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


      parent reply	other threads:[~2019-09-12  9:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19  3:28 [Qemu-devel] [PATCH v2] migration: cleanup check on ops in savevm.handlers iterations Wei Yang
2019-08-19 13:50 ` Juan Quintela
2019-08-19 14:09   ` Wei Yang
2019-09-12  9:55 ` Dr. David Alan Gilbert [this message]

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=20190912095543.GB7230@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 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).