qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vmdk: fix comment for vmdk_co_write_zeroes
@ 2013-08-01 10:12 Fam Zheng
  2013-08-02 14:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: Fam Zheng @ 2013-08-01 10:12 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: Fam Zheng, mjt

The comment was truncated. Add the missing parts, especially explain why
we need zero_dry_run.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/vmdk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/vmdk.c b/block/vmdk.c
index 3756333..e6c50b1 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1200,8 +1200,10 @@ static coroutine_fn int vmdk_co_read(BlockDriverState *bs, int64_t sector_num,
 /**
  * vmdk_write:
  * @zeroed:       buf is ignored (data is zero), use zeroed_grain GTE feature
- * if possible, otherwise return -ENOTSUP.
- * @zero_dry_run: used for zeroed == true only, don't update L2 table, just
+ *                if possible, otherwise return -ENOTSUP.
+ * @zero_dry_run: used for zeroed == true only, don't update L2 table, just try
+ *                with each cluster. By dry run we can find if the zero write
+ *                is possible without modifying image data.
  *
  * Returns: error code with 0 for success.
  */
@@ -1328,6 +1330,8 @@ static int coroutine_fn vmdk_co_write_zeroes(BlockDriverState *bs,
     int ret;
     BDRVVmdkState *s = bs->opaque;
     qemu_co_mutex_lock(&s->lock);
+    /* write zeroes could fail if sectors not aligned to cluster, test it with
+     * dry_run == true before really updating image */
     ret = vmdk_write(bs, sector_num, NULL, nb_sectors, true, true);
     if (!ret) {
         ret = vmdk_write(bs, sector_num, NULL, nb_sectors, true, false);
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] vmdk: fix comment for vmdk_co_write_zeroes
  2013-08-01 10:12 [Qemu-devel] [PATCH] vmdk: fix comment for vmdk_co_write_zeroes Fam Zheng
@ 2013-08-02 14:07 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2013-08-02 14:07 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-trivial, qemu-devel

01.08.2013 14:12, Fam Zheng wrote:
> The comment was truncated. Add the missing parts, especially explain why
> we need zero_dry_run.
>

Thanks, applied to the trivial patches queue.

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-02 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01 10:12 [Qemu-devel] [PATCH] vmdk: fix comment for vmdk_co_write_zeroes Fam Zheng
2013-08-02 14:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).