[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 14/43] block migration: fix return value
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 14/43] block migration: fix return value |
Date: |
Tue, 24 Feb 2015 15:47:49 -0600 |
From: Gary R Hook <address@hidden>
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 <address@hidden>
Reviewed-by: ChenLiang <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit ebd9fbd7e102c533143c2c8372312b75c2b2678a)
Signed-off-by: Michael Roth <address@hidden>
---
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
- [Qemu-stable] Patch Round-up for stable 2.2.1, freeze on 2015-03-05, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 09/43] iotests: Add test for unsupported image creation, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 10/43] qcow2: Prevent numerical overflow, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 14/43] block migration: fix return value,
Michael Roth <=
- [Qemu-stable] [PATCH 13/43] block/raw-posix: Fix ret in raw_open_common(), Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 11/43] qcow2: Flushing the caches in qcow2_close may fail, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 17/43] block: Don't probe for unknown backing file format, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 16/43] qcow2.py: Add required padding for header extensions, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 18/43] linuxboot: fix loading old kernels, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 12/43] qcow2: Respect bdrv_truncate() error, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 19/43] audio: Don't free hw resources until after hw backend is stopped, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 23/43] atomic: fix position of volatile qualifier, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 01/43] block: Make essential BlockDriver objects public, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 22/43] migration/block: fix pending() return value, Michael Roth, 2015/02/24