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 <vsement...@virtuozzo.com>
---
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