• A
    block: Allow child references on reopen · db905283
    Alberto Garcia 提交于
    In the previous patches we removed all child references from
    bs->{options,explicit_options} because keeping them is useless and
    wrong.
    
    Because of this, any attempt to reopen a BlockDriverState using a
    child reference as one of its options would result in a failure,
    because bdrv_reopen_prepare() would detect that there's a new option
    (the child reference) that wasn't present in bs->options.
    
    But passing child references on reopen can be useful. It's a way to
    specify a BDS's child without having to pass recursively all of the
    child's options, and if the reference points to a different BDS then
    this can allow us to replace the child.
    
    However, replacing the child is something that needs to be implemented
    case by case and only when it makes sense. For now, this patch allows
    passing a child reference as long as it points to the current child of
    the BlockDriverState.
    
    It's also important to remember that, as a consequence of the
    previous patches, this child reference will be removed from
    bs->{options,explicit_options} after the reopening has been completed.
    Signed-off-by: NAlberto Garcia <berto@igalia.com>
    Reviewed-by: NMax Reitz <mreitz@redhat.com>
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    db905283
block.c 159.9 KB