Received: from eggs.gnu.org ([2001:4830:134:3::10]:58274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9saG-0002h6-BJ for qemu-devel@nongnu.org; Sat, 21 Apr 2018 09:29:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9saF-0000FX-E0 for qemu-devel@nongnu.org; Sat, 21 Apr 2018 09:29:44 -0400 From: Max Reitz Date: Sat, 21 Apr 2018 15:29:22 +0200 Message-Id: <20180421132929.21610-3-mreitz@redhat.com> In-Reply-To: <20180421132929.21610-1-mreitz@redhat.com> References: <20180421132929.21610-1-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v2 2/9] block: BLK_PERM_WRITE includes ..._UNCHANGED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Alberto Garcia , Kevin Wolf Currently we never actually check whether the WRITE_UNCHANGED permission has been taken for unchanging writes. But the one check that is commented out checks both WRITE and WRITE_UNCHANGED; and considering that WRITE_UNCHANGED is already documented as being weaker than WRITE, we should probably explicitly document WRITE to include WRITE_UNCHANGED. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia --- include/block/block.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/block/block.h b/include/block/block.h index cdec3639a3..397b5e8d44 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -205,6 +205,9 @@ enum { * This permission (which is weaker than BLK_PERM_WRITE) is both enough and * required for writes to the block node when the caller promises that * the visible disk content doesn't change. + * + * As the BLK_PERM_WRITE permission is strictly stronger, either is + * sufficient to perform an unchanging write. */ BLK_PERM_WRITE_UNCHANGED = 0x04, -- 2.14.3