qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/5] block: support compressed write for copy-on


From: Anton Nefedov
Subject: Re: [Qemu-devel] [PATCH 3/5] block: support compressed write for copy-on-read
Date: Thu, 16 Nov 2017 13:05:09 +0300
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0


On 15/11/2017 9:49 PM, Max Reitz wrote:
On 2017-11-14 11:16, Anton Nefedov wrote:
Signed-off-by: Anton Nefedov <address@hidden>
---
  block/io.c         | 30 ++++++++++++++++++++++++------
  block/trace-events |  2 +-
  2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/block/io.c b/block/io.c
index 3d5ef2c..93c6b24 100644
--- a/block/io.c
+++ b/block/io.c

[...]

@@ -1209,6 +1220,13 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child,
          return ret;
      }
+ /* write compressed only makes sense with copy on read */
+    if ((flags & BDRV_REQ_WRITE_COMPRESSED) &&
+        !(flags & BDRV_REQ_COPY_ON_READ))
+    {
+        return -EINVAL;
+    }
+

I think the assertion in bdrv_aligned_preadv() should be enough, but
either way:

Reviewed-by: Max Reitz <address@hidden>


Ok, and it will fail more loudly. Will remove.

      bdrv_inc_in_flight(bs);
/* Don't do copy-on-read if we read data before write operation */




reply via email to

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