On 10.11.21 13:51, Vladimir Sementsov-Ogievskiy wrote:
04.11.2021 13:38, Hanna Reitz wrote:
The children list is specific to BDS parents.  We should not modify it
in the general children modification code, but let BDS parents deal with
it in their .attach() and .detach() methods.

This also has the advantage that a BdrvChild is removed from the
children list before its .bs pointer can become NULL.  BDS parents
generally assume that their children's .bs pointer is never NULL, so
this is actually a bug fix.

Signed-off-by: Hanna Reitz<hre...@redhat.com>


Interesting that nor child_root neither child_job do similar things in .attach / .detach ... Should we do something with it?

Well, it’s up to them, I thought. :)

A BB only has a single child, so it doesn’t need a list.  Jobs do have their own child list (BlockJob.nodes).  I thought a bit about this when writing this series, and I figured perhaps they don’t need to care about that in .attach() and .detach(), because they don’t really expect nodes to be detached or attached anyway; child_job.stay_at_node is true, after all.

Hanna


Reply via email to