qemu-e2k/block
Max Reitz ddf3b47ef4 qcow2: Do not mark inactive images corrupt
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: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180606193702.7113-3-mreitz@redhat.com
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-06-11 16:18:45 +02:00
..
accounting.c block/accounting: introduce latency histogram 2018-03-19 14:58:37 -05:00
backup.c job: Add error message for failing jobs 2018-05-30 13:31:01 +02:00
blkdebug.c block: Support BDRV_REQ_WRITE_UNCHANGED in filters 2018-05-15 16:15:21 +02:00
blkreplay.c block: Support BDRV_REQ_WRITE_UNCHANGED in filters 2018-05-15 16:15:21 +02:00
blkverify.c block: Support BDRV_REQ_WRITE_UNCHANGED in filters 2018-05-15 16:15:21 +02:00
block-backend.c block-backend: Add blk_co_copy_range 2018-06-01 14:41:48 +01:00
bochs.c
cloop.c
commit.c job: Add error message for failing jobs 2018-05-30 13:31:01 +02:00
copy-on-read.c block: Support BDRV_REQ_WRITE_UNCHANGED in filters 2018-05-15 16:15:21 +02:00
create.c block/create: Mark blockdev-create stable 2018-05-30 13:31:18 +02:00
crypto.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
crypto.h
curl.c
dirty-bitmap.c dirty-bitmap: add locked state 2018-03-13 17:05:00 -04:00
dmg-bz2.c
dmg.c
dmg.h
file-posix.c block/file-posix: File locking during creation 2018-06-11 16:18:45 +02:00
file-win32.c file-win32: Switch to byte-based callbacks 2018-05-15 16:11:41 +02:00
gluster.c block: Merge .bdrv_co_writev{,_flags} in drivers 2018-05-15 16:11:41 +02:00
io.c block: Introduce API for copy offloading 2018-06-01 14:41:47 +01:00
iscsi-opts.c
iscsi.c iscsi: Implement copy offloading 2018-06-01 14:41:48 +01:00
linux-aio.c
Makefile.objs block: Add COR filter driver 2018-05-15 16:15:21 +02:00
mirror.c job: Add error message for failing jobs 2018-05-30 13:31:01 +02:00
nbd-client.c nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply 2018-05-04 08:23:39 -05:00
nbd-client.h nbd: BLOCK_STATUS for standard get_block_status function: client part 2018-03-13 15:43:48 -05:00
nbd.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
nfs.c nfs: Remove processed options from QDict 2018-05-16 13:37:47 -04:00
null.c null: Switch to byte-based read/write 2018-05-15 16:11:41 +02:00
nvme.c qobject: Modify qobject_ref() to return obj 2018-05-04 08:27:53 +02:00
parallels.c block: Merge .bdrv_co_writev{,_flags} in drivers 2018-05-15 16:11:41 +02:00
parallels.h
qapi.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
qcow2-bitmap.c block/qcow2-bitmap: fix free_bitmap_clusters 2018-06-11 16:18:45 +02:00
qcow2-cache.c
qcow2-cluster.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
qcow2-refcount.c qcow2: Repair OFLAG_COPIED when fixing leaks 2018-06-11 16:18:45 +02:00
qcow2-snapshot.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
qcow2.c qcow2: Do not mark inactive images corrupt 2018-06-11 16:18:45 +02:00
qcow2.h qcow2: Give the refcount cache the minimum possible size by default 2018-05-15 16:15:21 +02:00
qcow.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
qed-check.c block: convert bdrv_check callback to coroutine_fn 2018-03-09 15:17:47 +01:00
qed-cluster.c
qed-l2-cache.c
qed-table.c block: convert bdrv_check callback to coroutine_fn 2018-03-09 15:17:47 +01:00
qed.c block: Merge .bdrv_co_writev{,_flags} in drivers 2018-05-15 16:11:41 +02:00
qed.h
quorum.c Remove unnecessary variables for function return value 2018-05-20 08:48:13 +03:00
raw-format.c raw: Implement copy offloading 2018-06-01 14:41:47 +01:00
rbd.c rbd: Switch to byte-based callbacks 2018-05-15 16:11:41 +02:00
replication.c job: Move completion and cancellation to Job 2018-05-23 14:30:51 +02:00
sheepdog.c sheepdog: remove huge BSS object 2018-06-05 10:15:12 -04:00
snapshot.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
ssh.c block: Merge .bdrv_co_writev{,_flags} in drivers 2018-05-15 16:11:41 +02:00
stream.c job: Add error message for failing jobs 2018-05-30 13:31:01 +02:00
throttle-groups.c
throttle.c throttle: Fix crash on reopen 2018-06-11 16:18:45 +02:00
trace-events job: Move completion and cancellation to Job 2018-05-23 14:30:51 +02:00
vdi.c vdi: Fix vdi_co_do_create() return value 2018-05-29 22:19:57 +02:00
vhdx-endian.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
vhdx-log.c block: use local path for local headers 2018-05-31 04:16:06 +03:00
vhdx.c acpi, vhost, misc: fixes, features 2018-06-04 10:15:16 +01:00
vhdx.h
vmdk.c vmdk: return ERROR when cluster sector is larger than vmdk limitation 2018-03-26 21:17:24 +02:00
vpc.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
vvfat.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
vxhs.c vxhs: Switch to byte-based callbacks 2018-05-15 16:11:41 +02:00
win32-aio.c file-win32: Switch to byte-based callbacks 2018-05-15 16:11:41 +02:00
write-threshold.c