All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChenLiang <chenliang88@huawei.com>
To: grhookatwork@gmail.com
Cc: Kevin Wolf <kwolf@redhat.com>, Gonglei <arei.gonglei@huawei.com>,
	Gary R Hook <gary.hook@nimboxx.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] Block migration: fix return value
Date: Wed, 26 Nov 2014 09:55:55 +0800	[thread overview]
Message-ID: <5475332B.8090206@huawei.com> (raw)
In-Reply-To: <1416958202-15913-1-git-send-email-gary.hook@nimboxx.com>

On 2014/11/26 7:30, grhookatwork@gmail.com wrote:

> From: Gary R Hook <gary.hook@nimboxx.com>
> 
> Modify block_save_iterate() to return positive/zero/negative
> (success/not done/failure) return status. The computation of
> the blocks transferred (an int64_t) exceeds the size of an
> int return value.
> 
> Signed-off-by: Gary R Hook <gary.hook@nimboxx.com>
> 
> ---
>  block-migration.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/block-migration.c b/block-migration.c
> index 08db01a..74d9eb1 100644
> --- a/block-migration.c
> +++ b/block-migration.c
> @@ -653,6 +653,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
>  {
>      int ret;
>      int64_t last_ftell = qemu_ftell(f);
> +    int64_t delta_ftell;
>  
>      DPRINTF("Enter save live iterate submitted %d transferred %d\n",
>              block_mig_state.submitted, block_mig_state.transferred);
> @@ -702,7 +703,14 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
>      }
>  
>      qemu_put_be64(f, BLK_MIG_FLAG_EOS);
> -    return qemu_ftell(f) - last_ftell;
> +    delta_ftell = qemu_ftell(f) - last_ftell;
> +    if (delta_ftell > 0) {
> +        return 1;
> +    } else if (delta_ftell < 0) {
> +        return -1;
> +    } else {
> +        return 0;
> +    }
>  }
>  
>  /* Called with iothread lock taken.  */


Reviewed-by: ChenLiang <chenliang88@huawei.com>

  reply	other threads:[~2014-11-26  1:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 23:30 [Qemu-devel] [PATCH v2] Block migration: fix return value grhookatwork
2014-11-26  1:55 ` ChenLiang [this message]
2014-11-27 16:37 ` Stefan Hajnoczi
2014-12-09 15:25 ` Stefan Hajnoczi

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=5475332B.8090206@huawei.com \
    --to=chenliang88@huawei.com \
    --cc=arei.gonglei@huawei.com \
    --cc=gary.hook@nimboxx.com \
    --cc=grhookatwork@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 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.