[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 34/37] block: Document BDRV_REQ_WRITE_UNCHANGED suppo
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 34/37] block: Document BDRV_REQ_WRITE_UNCHANGED support |
Date: |
Tue, 15 May 2018 17:40:30 +0200 |
From: Max Reitz <address@hidden>
Add BDRV_REQ_WRITE_UNCHANGED to the list of flags honored during pwrite
and pwrite_zeroes, and also add a note on when you absolutely need to
support it.
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
include/block/block_int.h | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index e3d6219f4e..76b589da57 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -656,10 +656,24 @@ struct BlockDriverState {
/* I/O Limits */
BlockLimits bl;
- /* Flags honored during pwrite (so far: BDRV_REQ_FUA) */
+ /* Flags honored during pwrite (so far: BDRV_REQ_FUA,
+ * BDRV_REQ_WRITE_UNCHANGED).
+ * If a driver does not support BDRV_REQ_WRITE_UNCHANGED, those
+ * writes will be issued as normal writes without the flag set.
+ * This is important to note for drivers that do not explicitly
+ * request a WRITE permission for their children and instead take
+ * the same permissions as their parent did (this is commonly what
+ * block filters do). Such drivers have to be aware that the
+ * parent may have taken a WRITE_UNCHANGED permission only and is
+ * issuing such requests. Drivers either must make sure that
+ * these requests do not result in plain WRITE accesses (usually
+ * by supporting BDRV_REQ_WRITE_UNCHANGED, and then forwarding
+ * every incoming write request as-is, including potentially that
+ * flag), or they have to explicitly take the WRITE permission for
+ * their children. */
unsigned int supported_write_flags;
/* Flags honored during pwrite_zeroes (so far: BDRV_REQ_FUA,
- * BDRV_REQ_MAY_UNMAP) */
+ * BDRV_REQ_MAY_UNMAP, BDRV_REQ_WRITE_UNCHANGED) */
unsigned int supported_zero_flags;
/* the following member gives a name to every node on the bs graph. */
--
2.13.6
- [Qemu-devel] [PULL 17/37] iotests: Split 214 off of 122, (continued)
- [Qemu-devel] [PULL 17/37] iotests: Split 214 off of 122, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 27/37] block: Set BDRV_REQ_WRITE_UNCHANGED for COR writes, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 22/37] iotests: Add failure matching to common.qemu, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 26/37] block: Add BDRV_REQ_WRITE_UNCHANGED flag, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 21/37] docs: Document the new default sizes of the qcow2 caches, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 18/37] Fix error message about compressed clusters with OFLAG_COPIED, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 28/37] block/quorum: Support BDRV_REQ_WRITE_UNCHANGED, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 25/37] block: BLK_PERM_WRITE includes ..._UNCHANGED, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 29/37] block: Support BDRV_REQ_WRITE_UNCHANGED in filters, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 30/37] iotests: Clean up wrap image in 197, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 34/37] block: Document BDRV_REQ_WRITE_UNCHANGED support,
Kevin Wolf <=
- [Qemu-devel] [PULL 33/37] qemu-img: Check post-truncation size, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 35/37] qemu-io: Use purely string blockdev options, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 31/37] iotests: Copy 197 for COR filter driver, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 24/37] block: Add COR filter driver, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 32/37] iotests: Add test for COR across nodes, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 36/37] qemu-img: Use only string options in img_open_opts, Kevin Wolf, 2018/05/15
- [Qemu-devel] [PULL 37/37] iotests: Add test for -U/force-share conflicts, Kevin Wolf, 2018/05/15
- Re: [Qemu-devel] [PULL 00/37] Block layer patches, Peter Maydell, 2018/05/15