[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/39] block: Allow .bdrv_load/save_vmstate() to retu
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 23/39] block: Allow .bdrv_load/save_vmstate() to return 0/-errno |
Date: |
Thu, 16 Jun 2016 16:08:12 +0200 |
The return value of .bdrv_load/save_vmstate() can be any non-negative
number in case of success now. It used to be bytes/-errno.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/io.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/block/io.c b/block/io.c
index aac9b67..af4d43e 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1848,9 +1848,16 @@ int bdrv_save_vmstate(BlockDriverState *bs, const
uint8_t *buf,
.iov_base = (void *) buf,
.iov_len = size,
};
+ int ret;
qemu_iovec_init_external(&qiov, &iov, 1);
- return bdrv_writev_vmstate(bs, &qiov, pos);
+
+ ret = bdrv_writev_vmstate(bs, &qiov, pos);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return size;
}
int bdrv_writev_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos)
@@ -1876,9 +1883,15 @@ int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,
.iov_base = buf,
.iov_len = size,
};
+ int ret;
qemu_iovec_init_external(&qiov, &iov, 1);
- return bdrv_readv_vmstate(bs, &qiov, pos);
+ ret = bdrv_readv_vmstate(bs, &qiov, pos);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return size;
}
int bdrv_readv_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos)
--
1.8.3.1
- [Qemu-devel] [PULL 09/39] qemu-img bench: Fix uninitialised writethrough mode, (continued)
- [Qemu-devel] [PULL 09/39] qemu-img bench: Fix uninitialised writethrough mode, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 10/39] block: Avoid bogus flags during mirroring, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 13/39] block: Byte-based bdrv_co_do_copy_on_readv(), Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 19/39] linux-aio: Cancel BH if not needed, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 20/39] doc: Fix mailing list address in tests/qemu-iotests/README, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 16/39] raw-posix: Switch to bdrv_co_* interfaces, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 18/39] block: Don't enforce 512 byte minimum alignment, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 21/39] block: Introduce bdrv_preadv(), Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 24/39] block: Make bdrv_load/save_vmstate coroutine_fns, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 17/39] raw-posix: Implement .bdrv_co_preadv/pwritev, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 23/39] block: Allow .bdrv_load/save_vmstate() to return 0/-errno,
Kevin Wolf <=
- [Qemu-devel] [PULL 30/39] block: Prevent sleeping jobs from resuming if they have been paused, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 22/39] block: Make .bdrv_load_vmstate() vectored, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 29/39] block: use the block job list in qmp_query_block_jobs(), Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 25/39] qcow2: Let vmstate call qcow2_co_preadv/pwrite directly, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 27/39] block: Fix snapshot=on with aio=native, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 28/39] block: use the block job list in bdrv_drain_all(), Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 26/39] block: Remove bs->zero_beyond_eof, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 31/39] block: Create the commit block job before reopening any image, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 34/39] block: Allow replacement of a BDS by its overlay, Kevin Wolf, 2016/06/16
- [Qemu-devel] [PULL 37/39] iotests: Add test for post-mirror backing chains, Kevin Wolf, 2016/06/16