qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] Block migration: fix return value
@ 2014-11-25 23:30 grhookatwork
  2014-11-26  1:55 ` ChenLiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: grhookatwork @ 2014-11-25 23:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gary R Hook

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.  */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] Block migration: fix return value
  2014-11-25 23:30 [Qemu-devel] [PATCH v2] Block migration: fix return value grhookatwork
@ 2014-11-26  1:55 ` ChenLiang
  2014-11-27 16:37 ` Stefan Hajnoczi
  2014-12-09 15:25 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: ChenLiang @ 2014-11-26  1:55 UTC (permalink / raw)
  To: grhookatwork
  Cc: Kevin Wolf, Gonglei, Gary R Hook, qemu-devel, Stefan Hajnoczi

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] Block migration: fix return value
  2014-11-25 23:30 [Qemu-devel] [PATCH v2] Block migration: fix return value grhookatwork
  2014-11-26  1:55 ` ChenLiang
@ 2014-11-27 16:37 ` Stefan Hajnoczi
  2014-12-09 15:25 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2014-11-27 16:37 UTC (permalink / raw)
  To: grhookatwork; +Cc: Peter Maydell, Gary R Hook, qemu-devel, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

On Tue, Nov 25, 2014 at 05:30:02PM -0600, 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(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] Block migration: fix return value
  2014-11-25 23:30 [Qemu-devel] [PATCH v2] Block migration: fix return value grhookatwork
  2014-11-26  1:55 ` ChenLiang
  2014-11-27 16:37 ` Stefan Hajnoczi
@ 2014-12-09 15:25 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2014-12-09 15:25 UTC (permalink / raw)
  To: grhookatwork; +Cc: Gary R Hook, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

On Tue, Nov 25, 2014 at 05:30:02PM -0600, 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(-)

Thanks, applied to my block-next tree:
https://github.com/stefanha/qemu/commits/block-next

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-09 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 23:30 [Qemu-devel] [PATCH v2] Block migration: fix return value grhookatwork
2014-11-26  1:55 ` ChenLiang
2014-11-27 16:37 ` Stefan Hajnoczi
2014-12-09 15:25 ` Stefan Hajnoczi

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).