qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3] block/backup-top: fix flags handling


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v3] block/backup-top: fix flags handling
Date: Fri, 7 Feb 2020 19:47:11 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

07.02.2020 19:30, Max Reitz wrote:
On 07.02.20 17:12, Vladimir Sementsov-Ogievskiy wrote:
backup-top "supports" write-unchanged, by skipping CBW operation in
backup_top_co_pwritev. But it forgets to do the same in
backup_top_co_pwrite_zeroes, as well as declare support for
BDRV_REQ_WRITE_UNCHANGED.

Fix this, and, while being here, declare also support for flags
supported by source child.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---

v3: rebase on master, keep state initialization after check top != NULL.

v2: restrict flags propagation like it is done in other filters [Eric]
     move state variable initialization to the top
  block/backup-top.c | 31 ++++++++++++++++++++-----------
  1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/block/backup-top.c b/block/backup-top.c
index fa78f3256d..1bfb360bd3 100644
--- a/block/backup-top.c
+++ b/block/backup-top.c

[...]

@@ -196,8 +200,13 @@ BlockDriverState *bdrv_backup_top_append(BlockDriverState 
*source,
          return NULL;
      }
- top->total_sectors = source->total_sectors;
      state = top->opaque;
+    top->total_sectors = source->total_sectors;

This looks a bit accidental, but, well, whatever.

I failed to restrict myself in a wish to keep all "top->.. =" initializers went 
together :)
Hmm, I could "state =" intializer to go after them. But it's good to keep it at 
top too.


Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block



Thanks!


--
Best regards,
Vladimir



reply via email to

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