[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 25/27] commit: Make base read-only if there is an ear
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 25/27] commit: Make base read-only if there is an early failure |
Date: |
Tue, 30 Apr 2019 17:42:42 +0200 |
From: Alberto Garcia <address@hidden>
You can reproduce this by passing an invalid filter-node-name (like
"1234") to block-commit. In this case the base image is put in
read-write mode but is never reset back to read-only.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/commit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/commit.c b/block/commit.c
index 08204fa6f8..27537d995b 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -383,6 +383,9 @@ fail:
if (s->top) {
blk_unref(s->top);
}
+ if (s->base_read_only) {
+ bdrv_reopen_set_read_only(base, true, NULL);
+ }
job_early_fail(&s->common.job);
/* commit_top_bs has to be replaced after deleting the block job,
* otherwise this would fail because of lack of permissions. */
--
2.20.1
- [Qemu-block] [PULL 14/27] qcow2: Fix qcow2_make_empty() with external data file, (continued)
- [Qemu-block] [PULL 14/27] qcow2: Fix qcow2_make_empty() with external data file, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 15/27] qcow2: Fix error handling in the compression code, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 16/27] block: introduce byte-based io helpers, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 13/27] qemu-img: Make create hint at protocol options, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 20/27] block/parallels: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 23/27] block/stream: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 17/27] block/qcow2: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 18/27] block/qcow: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 21/27] block/backup: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 19/27] block/qed: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 25/27] commit: Make base read-only if there is an early failure,
Kevin Wolf <=
- [Qemu-block] [PULL 24/27] qemu-img: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 22/27] block/commit: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 26/27] iotests: Check that images are in read-only mode after block-commit, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 27/27] block/qed: add missed coroutine_fn markers, Kevin Wolf, 2019/04/30
- Re: [Qemu-block] [Qemu-devel] [PULL 00/27] Block layer patches, Peter Maydell, 2019/04/30