[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/29] qcow2: Fix qcow2_truncate() error return value
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 06/29] qcow2: Fix qcow2_truncate() error return value |
Date: |
Fri, 29 Jun 2018 16:09:36 +0200 |
If qcow2_alloc_clusters_at() returns an error, we do need to negate it
to get back the positive errno code for error_setg_errno(), but we still
need to return the negative error code.
Fixes: 772d1f973f87269f6a4a4ea4b880680f3779bbdf
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/qcow2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index a3a3aa2a97..6b2e1e1058 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3597,7 +3597,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t
offset,
if (clusters_allocated < 0) {
error_setg_errno(errp, -clusters_allocated,
"Failed to allocate data clusters");
- return -clusters_allocated;
+ return clusters_allocated;
}
assert(clusters_allocated == nb_new_data_clusters);
--
2.13.6
- [Qemu-devel] [PULL 00/29] Block layer patches, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 03/29] qapi/job: The next release will be 3.0, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 04/29] usb-storage: Add rerror/werror properties, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 02/29] block/crypto: Pacify Coverity after commit f853465aacb, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 05/29] hw/block/nvme: add optional parameter num_queues for nvme device, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 01/29] block-qdict: Pacify Coverity after commit f1b34a248e9, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 10/29] block: Use tracked request for truncate, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 12/29] qcow2: Remove dead check on !ret, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 06/29] qcow2: Fix qcow2_truncate() error return value,
Kevin Wolf <=
- [Qemu-devel] [PULL 09/29] block: Move bdrv_truncate() implementation to io.c, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 11/29] file-posix: Make .bdrv_co_truncate asynchronous, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 07/29] block: Convert .bdrv_truncate callback to coroutine_fn, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 14/29] block/crypto: Simplify block_crypto_{open, create}_opts_init(), Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 08/29] qcow2: Remove coroutine trampoline for preallocate_co(), Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 13/29] block: Move request tracking to children in copy offloading, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 16/29] qcow2: Free allocated clusters on write error, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 15/29] qemu-iotests: Update 026.out.nocache reference output, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 21/29] file-posix: Fix EINTR handling, Kevin Wolf, 2018/06/29
- [Qemu-devel] [PULL 19/29] qcow2: Fix src_offset in copy offloading, Kevin Wolf, 2018/06/29