Skip to content
  • Hanna Reitz's avatar
    9bd910e2
    block: Allow replacement of a BDS by its overlay · 9bd910e2
    Hanna Reitz authored
    
    
    change_parent_backing_link() asserts that the BDS to be replaced is not
    used as a backing file. However, we may want to replace a BDS by its
    overlay in which case that very link should not be redirected.
    
    For instance, when doing a sync=none drive-mirror operation, we may have
    the following BDS/BB forest before block job completion:
    
      target
    
      base <- source <- BlockBackend
    
    During job completion, we want to establish the source BDS as the
    target's backing node:
    
              target
                |
                v
      base <- source <- BlockBackend
    
    This makes the target a valid replacement for the source:
    
              target <- BlockBackend
                |
                v
      base <- source
    
    Without this modification to change_parent_backing_link() we have to
    inject the target into the graph before the source is its backing node,
    thus temporarily creating a wrong graph:
    
      target <- BlockBackend
    
      base <- source
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-id: 20160610185750.30956-2-mreitz@redhat.com
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    9bd910e2
    block: Allow replacement of a BDS by its overlay
    Hanna Reitz authored
    
    
    change_parent_backing_link() asserts that the BDS to be replaced is not
    used as a backing file. However, we may want to replace a BDS by its
    overlay in which case that very link should not be redirected.
    
    For instance, when doing a sync=none drive-mirror operation, we may have
    the following BDS/BB forest before block job completion:
    
      target
    
      base <- source <- BlockBackend
    
    During job completion, we want to establish the source BDS as the
    target's backing node:
    
              target
                |
                v
      base <- source <- BlockBackend
    
    This makes the target a valid replacement for the source:
    
              target <- BlockBackend
                |
                v
      base <- source
    
    Without this modification to change_parent_backing_link() we have to
    inject the target into the graph before the source is its backing node,
    thus temporarily creating a wrong graph:
    
      target <- BlockBackend
    
      base <- source
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-id: 20160610185750.30956-2-mreitz@redhat.com
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Loading