Skip to content
Snippets Groups Projects
  • Hanna Reitz's avatar
    ca08d937
    blockdev: Allow external snapshots everywhere · ca08d937
    Hanna Reitz authored
    
    There is no good reason why we would allow external snapshots only on
    the first non-filter node in a chain.  Parent BDSs should not care
    whether their child is replaced by a snapshot.  (If they do care, they
    should announce that via freezing the chain, which is checked in
    bdrv_append() through bdrv_set_backing_hd().)
    
    Before we had bdrv_is_first_non_filter() here (since 212a5a8f), there
    was a special function bdrv_check_ext_snapshot() that allowed snapshots
    by default, but block drivers could override this.  Only blkverify did
    so, however.
    
    It is not clear to me why blkverify would do so; maybe just so that the
    testee block driver would not be replaced.  The introducing commit
    f6186f49 does not explain why.  Maybe because 08b24cfe would have
    been the correct solution?  (Which adds a .supports_backing check.)
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200218103454.296704-2-mreitz@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    ca08d937
    History
    blockdev: Allow external snapshots everywhere
    Hanna Reitz authored
    
    There is no good reason why we would allow external snapshots only on
    the first non-filter node in a chain.  Parent BDSs should not care
    whether their child is replaced by a snapshot.  (If they do care, they
    should announce that via freezing the chain, which is checked in
    bdrv_append() through bdrv_set_backing_hd().)
    
    Before we had bdrv_is_first_non_filter() here (since 212a5a8f), there
    was a special function bdrv_check_ext_snapshot() that allowed snapshots
    by default, but block drivers could override this.  Only blkverify did
    so, however.
    
    It is not clear to me why blkverify would do so; maybe just so that the
    testee block driver would not be replaced.  The introducing commit
    f6186f49 does not explain why.  Maybe because 08b24cfe would have
    been the correct solution?  (Which adds a .supports_backing check.)
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200218103454.296704-2-mreitz@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>