Skip to content
Snippets Groups Projects
  • Peter Lieven's avatar
    0347a8fd
    block/rbd: implement bdrv_co_block_status · 0347a8fd
    Peter Lieven authored
    
    the qemu rbd driver currently lacks support for bdrv_co_block_status.
    This results mainly in incorrect progress during block operations (e.g.
    qemu-img convert with an rbd image as source).
    
    This patch utilizes the rbd_diff_iterate2 call from librbd to detect
    allocated and unallocated (all zero areas).
    
    To avoid querying the ceph OSDs for the answer this is only done if
    the image has the fast-diff feature which depends on the object-map and
    exclusive-lock features. In this case it is guaranteed that the information
    is present in memory in the librbd client and thus very fast.
    
    If fast-diff is not available all areas are reported to be allocated
    which is the current behaviour if bdrv_co_block_status is not implemented.
    
    Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
    Message-Id: <20211012152231.24868-1-pl@kamp.de>
    Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    0347a8fd
    History
    block/rbd: implement bdrv_co_block_status
    Peter Lieven authored
    
    the qemu rbd driver currently lacks support for bdrv_co_block_status.
    This results mainly in incorrect progress during block operations (e.g.
    qemu-img convert with an rbd image as source).
    
    This patch utilizes the rbd_diff_iterate2 call from librbd to detect
    allocated and unallocated (all zero areas).
    
    To avoid querying the ceph OSDs for the answer this is only done if
    the image has the fast-diff feature which depends on the object-map and
    exclusive-lock features. In this case it is guaranteed that the information
    is present in memory in the librbd client and thus very fast.
    
    If fast-diff is not available all areas are reported to be allocated
    which is the current behaviour if bdrv_co_block_status is not implemented.
    
    Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
    Message-Id: <20211012152231.24868-1-pl@kamp.de>
    Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
rbd.c 46.90 KiB