Re: [PATCH 1/1] block: add missed block_acct_setup with new block device init procedure

2022-07-26 Thread Denis V. Lunev
On 11.07.2022 13:07, Denis V. Lunev wrote: Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure

Re: [RFC patch 0/1] block: vhost-blk backend

2022-07-26 Thread Michael S. Tsirkin
On Mon, Jul 25, 2022 at 11:55:26PM +0300, Andrey Zhadchenko wrote: > Although QEMU virtio-blk is quite fast, there is still some room for > improvements. Disk latency can be reduced if we handle virito-blk requests > in host kernel so we avoid a lot of syscalls and context switches. > > The bigges

Re: [RFC patch 0/1] block: vhost-blk backend

2022-07-26 Thread Denis V. Lunev
On 26.07.2022 15:51, Michael S. Tsirkin wrote: On Mon, Jul 25, 2022 at 11:55:26PM +0300, Andrey Zhadchenko wrote: Although QEMU virtio-blk is quite fast, there is still some room for improvements. Disk latency can be reduced if we handle virito-blk requests in host kernel so we avoid a lot of sy

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: The aim of this series is to reorganize bdrv_try_set_aio_context and drop BDS ->set_aio_context and ->can_set_aio_ctx callbacks in favour of a new one, ->change_aio_ctx. More informations in patch 3 (which is also RFC, due to the doubts patch

Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions

2022-07-26 Thread Emanuele Giuseppe Esposito
Am 26/07/2022 um 16:24 schrieb Vladimir Sementsov-Ogievskiy: > On 7/25/22 15:21, Emanuele Giuseppe Esposito wrote: >> The aim of this series is to reorganize bdrv_try_set_aio_context >> and drop BDS ->set_aio_context and ->can_set_aio_ctx callbacks in >> favour of a new one, ->change_aio_ctx. >>

Re: [PATCH 0/2] block/parallels: Fix buffer-based write call

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
On 7/14/22 16:27, Hanna Reitz wrote: Hi, While reviewing Stefan’s libblkio driver series, I’ve noticed that block/parallels.c contains a call to bdrv_co_pwritev() that doesn’t pass a QEMUIOVector object but a plain buffer instead. That seems wrong and also pretty dangerous, so change it to a bd

[PATCH v3 05/21] block/vhost-user-blk-server: don't expose VHOST_USER_F_PROTOCOL_FEATURES

2022-07-26 Thread Alex Bennée
This bit is unused in actual VirtIO feature negotiation and should only appear in the vhost-user messages between master and slave. [AJB: experiment, this doesn't break the tests but I'm not super confident of the range of tests] Signed-off-by: Alex Bennée --- block/export/vhost-user-blk-server

[PATCH v7 01/15] block: BlockDriver: add .filtered_child_is_backing field

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Unfortunately not all filters use .file child as filtered child. Two exclusions are mirror_top and commit_top. Happily they both are private filters. Bad thing is that this inconsistency is observable through qmp commands query-block / query-named-block-nodes. So, could we just change mirror_top an

[PATCH v7 02/15] block: introduce bdrv_open_file_child() helper

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Almost all drivers call bdrv_open_child() similarly. Let's create a helper for this. The only not updated drivers that call bdrv_open_child() to set bs->file are raw-format and snapshot-access: raw-format sometimes want to have filtered child but don't set drv->is_filter to true. s

[PATCH v7 05/15] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
We do add COW child to the node. In future we are going to forbid adding COW child to the node that doesn't support backing. So, fix it here now. Don't worry about setting bs->backing itself: in further commit we'll update the block-layer to automatically set/unset this field in generic code. Si

[PATCH v7 04/15] test-bdrv-graph-mod: update test_parallel_perm_update test case

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
test_parallel_perm_update() does two things that we are going to restrict in the near future: 1. It updates bs->file field by hand. bs->file will be managed automatically by generic code (together with bs->children list). Let's better refactor our "tricky" bds to have own state where one

[PATCH v7 07/15] block: document connection between child roles and bs->backing/bs->file

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Make the informal rules formal. In further commit we'll add corresponding assertions. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- include/block/block-common.h | 39 1 file changed, 39 insertions(+) diff --git a/include/block/blo

[PATCH v7 08/15] block/snapshot: stress that we fallback to primary child

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Actually what we chose is a primary child. Let's stress it in the code. We are going to drop indirect pointer logic here in future. Actually this commit simplifies the future work: we drop use of indirection in the assertion now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Rei

[PATCH v7 10/15] Revert "block: Let replace_child_tran keep indirect pointer"

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
That's a preparation to previously reverted "block: Let replace_child_noperm free children". Drop it too, we don't need it for a new approach. This reverts commit 82b54cf51656bf3cd5ed1ac549e8a1085a0e3290. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block.c | 81 +++

[PATCH v7 14/15] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Now the indirection is not actually used, we can safely reduce it to simple pointer. For consistency do a bit of refactoring to get rid of _ptr suffixes that become meaningless. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/snapshot.c | 38 --

[PATCH v7 12/15] Revert "block: Pass BdrvChild ** to replace_child_noperm"

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
That's a preparation to previously reverted "block: Let replace_child_noperm free children". Drop it too, we don't need it for a new approach. This reverts commit be64bbb0149748f3999c49b13976aafb8330ea86. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block.c | 23 +++

[PATCH v7 06/15] test-bdrv-graph-mod: fix filters to be filters

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
bdrv_pass_through is used as filter, even all node variables has corresponding names. We want to append it, so it should be backing-child-based filter like mirror_top. So, in test_update_perm_tree, first child should be DATA, as we don't want filters with two filtered children. bdrv_exclusive_writ

[PATCH v7 09/15] Revert "block: Let replace_child_noperm free children"

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
We are going to reimplement this behavior (clear bs->file / bs->backing pointers automatically when child->bs is cleared) in a nicer way, see further commit "block: Manipulate bs->file / bs->backing pointers in .attach/.detach". With this revert we bring back a problem that was fixed by b0a9f6fed3

[PATCH v7 11/15] Revert "block: Restructure remove_file_or_backing_child()"

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
That's a preparation to previously reverted "block: Let replace_child_noperm free children". Drop it too, we don't need it for a new approach. This reverts commit 562bda8bb41879eeda0bd484dd3d55134579b28e. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block.c | 21 +++

[PATCH v7 for-7.2 00/15] block: cleanup backing and file handling

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Hi all! That's the first part of "[PATCH v5 00/45] Transactional block-graph modifying API", updated and is fully reviewed by Hanna. v7: add r-bs and rebase on master Vladimir Sementsov-Ogievskiy (15): block: BlockDriver: add .filtered_child_is_backing field block: introduce bdrv_open_file_c

[PATCH v7 03/15] block/blklogwrites: don't care to remove bs->file child on failure

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
We don't need to remove bs->file, generic layer takes care of it. No other driver cares to remove bs->file on failure by hand. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/blklogwrites.c | 4 1 file changed, 4 deletions(-) diff --git a/block/blklogwrites.

[PATCH v7 15/15] block: refactor bdrv_remove_file_or_backing_child to bdrv_remove_child

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
Now the function can remove any child, so give it more common name. Drop assertions and drop bs argument which becomes unused. Function would be reused in a further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block.c | 27 +-- 1 file

[PATCH v7 13/15] block: Manipulate bs->file / bs->backing pointers in .attach/.detach

2022-07-26 Thread Vladimir Sementsov-Ogievskiy
bs->file and bs->backing are a kind of duplication of part of bs->children. But very useful diplication, so let's not drop them at all:) We should manage bs->file and bs->backing in same place, where we manage bs->children, to keep them in sync. Moreover, generic io paths are unprepared to BdrvCh