[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 28/29] qcow2: Do not mark inactive images corrupt
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 28/29] qcow2: Do not mark inactive images corrupt |
Date: |
Mon, 11 Jun 2018 16:26:10 +0200 |
When signaling a corruption on a read-only image, qcow2 already makes
fatal events non-fatal (i.e., they will not result in the image being
closed, and the image header's corrupt flag will not be set). This is
necessary because we cannot set the corrupt flag on read-only images,
and it is possible because further corruption of read-only images is
impossible.
Inactive images are effectively read-only, too, so we should do the same
for them. bdrv_is_writable() can tell us whether an image can actually
be written to, so use its result instead of !bs->read_only.
(Otherwise, the assert(!(bs->open_flags & BDRV_O_INACTIVE)) in
bdrv_co_pwritev() will fail, crashing qemu.)
Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 6b2d88759d..6fa5e1d71a 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4569,7 +4569,7 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool
fatal, int64_t offset,
char *message;
va_list ap;
- fatal = fatal && !bs->read_only;
+ fatal = fatal && bdrv_is_writable(bs);
if (s->signaled_corruption &&
(!fatal || (s->incompatible_features & QCOW2_INCOMPAT_CORRUPT)))
--
2.17.1
- [Qemu-block] [PULL 18/29] qemu-img: Resolve relative backing paths in rebase, (continued)
- [Qemu-block] [PULL 18/29] qemu-img: Resolve relative backing paths in rebase, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 14/29] qemu-io: Let command functions return error code, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 13/29] qemu-io: Drop command functions' return values, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 20/29] qemu-img: Special post-backing convert handling, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 19/29] iotests: Add test for rebasing with relative paths, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 21/29] iotests: Test post-backing convert target behavior, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 22/29] iotests: improve pause_job, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 23/29] iotests: Fix 219's timing, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 26/29] throttle: Fix crash on reopen, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 25/29] block/qcow2-bitmap: fix free_bitmap_clusters, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 28/29] qcow2: Do not mark inactive images corrupt,
Max Reitz <=
- [Qemu-block] [PULL 24/29] qemu-img: Remove deprecated -s snapshot_id_or_name option, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 27/29] block: Make bdrv_is_writable() public, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 29/29] iotests: Add case for a corrupted inactive image, Max Reitz, 2018/06/11
- Re: [Qemu-block] [PULL 00/29] Block patches, Peter Maydell, 2018/06/11