Skip to content
Snippets Groups Projects
  • Kevin Wolf's avatar
    82dc8b41
    block: Fix .bdrv_open flags · 82dc8b41
    Kevin Wolf authored
    
    bdrv_common_open() modified bs->open_flags after inferring the set of
    options to pass to the driver's .bdrv_open callback. This means that the
    cache options were correctly set in bs->open_flags (and therefore
    correctly displayed in 'info block'), but the image would actually be
    opened with the default cache mode instead.
    
    This patch removes the flags parameter to bdrv_common_open() (except for
    BDRV_O_NO_BACKING it's the same as bs->open_flags anyway, and having two
    names for the same thing is confusing), and moves the assignment of
    open_flags down to immediately before calling into the block drivers. In
    all other places, bs->open_flags is now used consistently.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: default avatarDenis V. Lunev <den@openvz.org>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    82dc8b41
    History
    block: Fix .bdrv_open flags
    Kevin Wolf authored
    
    bdrv_common_open() modified bs->open_flags after inferring the set of
    options to pass to the driver's .bdrv_open callback. This means that the
    cache options were correctly set in bs->open_flags (and therefore
    correctly displayed in 'info block'), but the image would actually be
    opened with the default cache mode instead.
    
    This patch removes the flags parameter to bdrv_common_open() (except for
    BDRV_O_NO_BACKING it's the same as bs->open_flags anyway, and having two
    names for the same thing is confusing), and moves the assignment of
    open_flags down to immediately before calling into the block drivers. In
    all other places, bs->open_flags is now used consistently.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: default avatarDenis V. Lunev <den@openvz.org>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>