[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 23/39] block: Allow .bdrv_load/save_vmstate() to retu
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [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-block] [PULL 08/39] m25p80: fix test on blk_pread() return value, (continued)
- [Qemu-block] [PULL 08/39] m25p80: fix test on blk_pread() return value, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 03/39] qcow2: Make copy_sectors() byte based, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 05/39] qcow2: Implement .bdrv_co_pwritev(), Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 09/39] qemu-img bench: Fix uninitialised writethrough mode, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 07/39] hmp: acquire aio_context in hmp_qemu_io, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 06/39] blockdev: clarify error on attempt to open locked tray, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 14/39] block: Prepare bdrv_aligned_preadv() for byte-aligned requests, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 13/39] block: Byte-based bdrv_co_do_copy_on_readv(), Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 12/39] block: drop support for using qcow[2] encryption with system emulators, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 16/39] raw-posix: Switch to bdrv_co_* interfaces, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 23/39] block: Allow .bdrv_load/save_vmstate() to return 0/-errno,
Kevin Wolf <=
- [Qemu-block] [PULL 19/39] linux-aio: Cancel BH if not needed, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 21/39] block: Introduce bdrv_preadv(), Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 17/39] raw-posix: Implement .bdrv_co_preadv/pwritev, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 15/39] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 10/39] block: Avoid bogus flags during mirroring, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 11/39] block: Assert that flags are in range, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 20/39] doc: Fix mailing list address in tests/qemu-iotests/README, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 24/39] block: Make bdrv_load/save_vmstate coroutine_fns, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 18/39] block: Don't enforce 512 byte minimum alignment, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 29/39] block: use the block job list in qmp_query_block_jobs(), Kevin Wolf, 2016/06/16