• K
    block: Fix reconfiguring graph with drained nodes · 36fe1331
    Kevin Wolf 提交于
    When changing the BlockDriverState that a BdrvChild points to while the
    node is currently drained, we must call the .drained_end() parent
    callback. Conversely, when this means attaching a new node that is
    already drained, we need to call .drained_begin().
    
    bdrv_root_attach_child() takes now an opaque parameter, which is needed
    because the callbacks must also be called if we're attaching a new child
    to the BlockBackend when the root node is already drained, and they need
    a way to identify the BlockBackend. Previously, child->opaque was set
    too late and the callbacks would still see it as NULL.
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    Reviewed-by: NEric Blake <eblake@redhat.com>
    Reviewed-by: NFam Zheng <famz@redhat.com>
    36fe1331
block_int.h 28.7 KB