[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 04/17] block: Improve documentation of .bdrv_has_zero_init

From: Eric Blake
Subject: [PATCH 04/17] block: Improve documentation of .bdrv_has_zero_init
Date: Fri, 31 Jan 2020 11:44:23 -0600

Several drivers supply .bdrv_has_zero_init that returns 1, but lack
the .bdrv_has_zero_init_truncate callback (parallels and qed outright,
vdi in some scenarios).  A literal reading of the existing
documentation says such drivers are broken, because
bdrv_has_zero_init_truncate() defaults to zero if the callback is
missing; but in practice, the tie between the two functions is only
relevant when truncate is supported.  Clarify the documentation to
make it obvious that this is okay.

Fixes: 1dcaf527
Signed-off-by: Eric Blake <address@hidden>
 include/block/block_int.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/block/block_int.h b/include/block/block_int.h
index 640fb82c789e..77ab45dc87cf 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -444,7 +444,8 @@ struct BlockDriver {
      * Returns 1 if newly created images are guaranteed to contain only
      * zeros, 0 otherwise.
-     * Must return 0 if .bdrv_has_zero_init_truncate() returns 0.
+     * Must return 0 if .bdrv_co_truncate is set and
+     * .bdrv_has_zero_init_truncate() returns 0.
     int (*bdrv_has_zero_init)(BlockDriverState *bs);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]