05.11.2020 18:14, Alberto Garcia wrote:
On Sat 31 Oct 2020 01:35:01 PM CET, Vladimir Sementsov-Ogievskiy wrote:- QLIST_FOREACH_SAFE(c, &top->parents, next_parent, next) {/* ... */+ QLIST_FOREACH_SAFE(c, &base->parents, next_parent, next) {I also wonder, is top->parents and base->parents guaranteed to be the same list in this case? If not you could store the list of top->parents before calling bdrv_replace_node() and use it afterwards. QLIST_FOREACH(c, &top->parents, next_parent) { parents = g_slist_prepend(parents, c); } Berto
Hmm... We should not touch other parents of base, which it had prior to bdrv_replace_node(). On the other hand, it should be safe to call update_filename for not-updated parents.. And we should keep in mind that bdrv_replace_node may replace not all children. Still, in this case we must replace all of them. Seems, we need additional argument for bdrv_replace_node() to fail, if it want's to skip some children replacement. So, I'm going to resend to add this parameter to bdrv_replace_node() and will use your suggestion to be stricter on what we update, thanks! -- Best regards, Vladimir
