On 6/8/22 14:49, Hanna Reitz wrote:
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote:
To be used in further commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@openvz.org>
---
block.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
Looking at bdrv_child_try_set_aio_context(), it looks like
bdrv_can_set_aio_context() were supposed to be the .prepare action, and
bdrv_set_aio_context_ignore() should be the .commit action. Can we not use it
that way?
The difference is that we want the whole action be done in .prepare stage, not
only the check. It's generally better: when do several actions in a
transaction, actions usually depend on result of previous actions.
And I think it's necessary for graph update. Graph relations are changed during
other actions .prepare phases, so I can't imagine how to postpone aio-context
update to .commit phase.
But I agree, that having both _can_ / _set_ and *tran APIs don't look good.
May be we can refactor it.. But not in this series I think)
--
Best regards,
Vladimir