Skip to content
  • Alberto Garcia's avatar
    14499ea5
    block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags · 14499ea5
    Alberto Garcia authored
    
    
    If an image is opened with snapshot=on, its flags are modified by
    bdrv_backing_options() and then bs->open_flags is updated accordingly.
    This last step is unnecessary if we calculate the new flags before
    setting bs->open_flags.
    
    Soon we'll introduce the "read-only" option, and then we'll need to
    be able to modify its value in the QDict when snapshot=on. This is
    more cumbersome if bs->options is already set. This patch simplifies
    that. Other than that, there are no semantic changes. Although it
    might seem that bs->options can have a different value now because
    it is stored after calling bdrv_backing_options(), this call doesn't
    actually modify them in this scenario.
    
    The code that sets BDRV_O_ALLOW_RDWR is also moved for the same
    reason.
    
    Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    14499ea5
    block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags
    Alberto Garcia authored
    
    
    If an image is opened with snapshot=on, its flags are modified by
    bdrv_backing_options() and then bs->open_flags is updated accordingly.
    This last step is unnecessary if we calculate the new flags before
    setting bs->open_flags.
    
    Soon we'll introduce the "read-only" option, and then we'll need to
    be able to modify its value in the QDict when snapshot=on. This is
    more cumbersome if bs->options is already set. This patch simplifies
    that. Other than that, there are no semantic changes. Although it
    might seem that bs->options can have a different value now because
    it is stored after calling bdrv_backing_options(), this call doesn't
    actually modify them in this scenario.
    
    The code that sets BDRV_O_ALLOW_RDWR is also moved for the same
    reason.
    
    Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading