Skip to content
  • John Snow's avatar
    341ebc2f
    qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove · 341ebc2f
    John Snow authored
    
    
    The new command pair is added to manage a user created dirty bitmap. The
    dirty bitmap's name is mandatory and must be unique for the same device,
    but different devices can have bitmaps with the same names.
    
    The granularity is an optional field. If it is not specified, we will
    choose a default granularity based on the cluster size if available,
    clamped to between 4K and 64K to mirror how the 'mirror' code was
    already choosing granularity. If we do not have cluster size info
    available, we choose 64K. This code has been factored out into a helper
    shared with block/mirror.
    
    This patch also introduces the 'block_dirty_bitmap_lookup' helper,
    which takes a device name and a dirty bitmap name and validates the
    lookup, returning NULL and setting errp if there is a problem with
    either field. This helper will be re-used in future patches in this
    series.
    
    The types added to block-core.json will be re-used in future patches
    in this series, see:
    'qapi: Add transaction support to block-dirty-bitmap-{add, enable, disable}'
    
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-id: 1429314609-29776-5-git-send-email-jsnow@redhat.com
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    341ebc2f
    qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove
    John Snow authored
    
    
    The new command pair is added to manage a user created dirty bitmap. The
    dirty bitmap's name is mandatory and must be unique for the same device,
    but different devices can have bitmaps with the same names.
    
    The granularity is an optional field. If it is not specified, we will
    choose a default granularity based on the cluster size if available,
    clamped to between 4K and 64K to mirror how the 'mirror' code was
    already choosing granularity. If we do not have cluster size info
    available, we choose 64K. This code has been factored out into a helper
    shared with block/mirror.
    
    This patch also introduces the 'block_dirty_bitmap_lookup' helper,
    which takes a device name and a dirty bitmap name and validates the
    lookup, returning NULL and setting errp if there is a problem with
    either field. This helper will be re-used in future patches in this
    series.
    
    The types added to block-core.json will be re-used in future patches
    in this series, see:
    'qapi: Add transaction support to block-dirty-bitmap-{add, enable, disable}'
    
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-id: 1429314609-29776-5-git-send-email-jsnow@redhat.com
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading