On Fri 09 Oct 2015 02:15:38 PM CEST, Kevin Wolf wrote: > +static void change_parent_backing_link(BlockDriverState *from, > + BlockDriverState *to) > +{ > + BdrvChild *c, *next; > + > + QLIST_FOREACH_SAFE(c, &from->parents, next_parent, next) { > + assert(c->role != &child_backing); > + c->bs = to; > + QLIST_REMOVE(c, next_parent); > + QLIST_INSERT_HEAD(&to->parents, c, next_parent); > + bdrv_ref(to); > + bdrv_unref(from); > + } > + if (from->blk) { > + blk_set_bs(from->blk, to); > + if (!to->device_list.tqe_prev) { > + QTAILQ_INSERT_BEFORE(from, to, device_list); > + }
Is it even possible that this last condition is false? In what case would 'to' be already in bdrv_states? I understand that it would mean that it would already be attached to a BlockBackend, but that's not possible in this case. Berto