[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 39/99] qcow2: Do not mark inactive images corrupt
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 39/99] qcow2: Do not mark inactive images corrupt |
Date: |
Mon, 23 Jul 2018 15:16:48 -0500 |
From: Max Reitz <address@hidden>
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>
(cherry picked from commit ddf3b47ef4b5ed0bf6558d4c2c8ae130b8d8a580)
Signed-off-by: Michael Roth <address@hidden>
---
block/qcow2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index ef68772aca..a2b2e5d4cd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4386,7 +4386,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-stable] [PATCH 29/99] intel-iommu: introduce vtd_page_walk_info, (continued)
- [Qemu-stable] [PATCH 29/99] intel-iommu: introduce vtd_page_walk_info, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 28/99] intel-iommu: only do page walk for MAP notifiers, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 02/99] device_tree: Increase FDT_MAX_SIZE to 1 MiB, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 31/99] intel-iommu: trace domain id during page walk, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 34/99] arm_gicv3_kvm: increase clroffset accordingly, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 33/99] intel-iommu: rework the page walk logic, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 32/99] util: implement simple iova tree, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 35/99] Fix libusb-1.0.22 deprecated libusb_set_debug with libusb_set_option, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 36/99] ahci: fix PxCI register race, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 38/99] block: Make bdrv_is_writable() public, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 39/99] qcow2: Do not mark inactive images corrupt,
Michael Roth <=
- [Qemu-stable] [PATCH 37/99] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 40/99] iotests: Add case for a corrupted inactive image, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 03/99] ccid: Fix dwProtocols advertisement of T=0, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 41/99] throttle: Fix crash on reopen, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 42/99] i386: define the 'ssbd' CPUID feature bit (CVE-2018-3639), Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 43/99] i386: Define the Virt SSBD MSR and handling of it (CVE-2018-3639), Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 44/99] i386: define the AMD 'virt-ssbd' CPUID feature bit (CVE-2018-3639), Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 46/99] vhost-user: delete net client if necessary, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 45/99] tap: set vhostfd passed from qemu cli to non-blocking, Michael Roth, 2018/07/23
- [Qemu-stable] [PATCH 47/99] qemu-img: Fix assert when mapping unaligned raw file, Michael Roth, 2018/07/23