• K
    block: Add BDRV_O_RESIZE for blk_new_open() · 55880601
    Kevin Wolf 提交于
    blk_new_open() is a convenience function that processes flags rather
    than QDict options as a simple way to just open an image file.
    
    In order to keep it convenient in the future, it must automatically
    request the necessary permissions. This can easily be inferred from the
    flags for read and write, but we need another flag that tells us whether
    to get the resize permission.
    
    We can't just always request it because that means that no block jobs
    can run on the resulting BlockBackend (which is something that e.g.
    qemu-img commit wants to do), but we also can't request it never because
    most of the .bdrv_create() implementations call blk_truncate().
    
    The solution is to introduce another flag that is passed by all users
    that want to resize the image.
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    Acked-by: NFam Zheng <famz@redhat.com>
    Reviewed-by: NMax Reitz <mreitz@redhat.com>
    55880601
qcow2.c 110.6 KB