[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 2/2] qcow2: Translate -ERANGE to -ENOSPC
From: |
Fam Zheng |
Subject: |
[Qemu-block] [PATCH 2/2] qcow2: Translate -ERANGE to -ENOSPC |
Date: |
Thu, 22 Oct 2015 16:17:38 +0800 |
This will make the default werror (=enospc) work better when qcow2 is
created on top of iscsi or other block devices.
Signed-off-by: Fam Zheng <address@hidden>
---
block/qcow2.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index bacc4f2..8edf0fe 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1586,6 +1586,12 @@ static coroutine_fn int qcow2_co_writev(BlockDriverState
*bs,
cur_nr_sectors, &hd_qiov);
qemu_co_mutex_lock(&s->lock);
if (ret < 0) {
+ if (ret == -ERANGE) {
+ /* Out of range access means we're already allocating clusters
+ * beyond end of disk, fix the error code to support
+ * werror=enospc. */
+ ret = -ENOSPC;
+ }
goto fail;
}
--
2.4.3
[Qemu-block] [PATCH 2/2] qcow2: Translate -ERANGE to -ENOSPC,
Fam Zheng <=
Re: [Qemu-block] [PATCH 0/2] Fix werror=enospc for qcow2 on iscsi, Peter Lieven, 2015/10/22
Re: [Qemu-block] [PATCH 0/2] Fix werror=enospc for qcow2 on iscsi, Paolo Bonzini, 2015/10/22