Skip to content
  • Kevin Wolf's avatar
    73176bee
    block: Fix snapshot=on cache modes · 73176bee
    Kevin Wolf authored
    
    
    Since commit 91a097e7, we end up with a somewhat weird cache mode
    configuration with snapshot=on: The commit broke the cache mode
    inheritance for the snapshot overlay so that it is opened as
    writethrough instead of unsafe now. The following bdrv_append() call to
    put it on top of the tree swaps the WCE flag with the snapshot's backing
    file (i.e. the originally given file), so what we eventually get is
    cache=writeback on the temporary overlay and
    cache=writethrough,cache.no-flush=on on the real image file.
    
    This patch changes things so that the temporary overlay gets
    cache=unsafe again like it used to, and the real images get whatever the
    user specified. This means that cache.direct is now respected even with
    snapshot=on, and in the case of committing changes, the final flush is
    no longer ignored except explicitly requested by the user.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    73176bee
    block: Fix snapshot=on cache modes
    Kevin Wolf authored
    
    
    Since commit 91a097e7, we end up with a somewhat weird cache mode
    configuration with snapshot=on: The commit broke the cache mode
    inheritance for the snapshot overlay so that it is opened as
    writethrough instead of unsafe now. The following bdrv_append() call to
    put it on top of the tree swaps the WCE flag with the snapshot's backing
    file (i.e. the originally given file), so what we eventually get is
    cache=writeback on the temporary overlay and
    cache=writethrough,cache.no-flush=on on the real image file.
    
    This patch changes things so that the temporary overlay gets
    cache=unsafe again like it used to, and the real images get whatever the
    user specified. This means that cache.direct is now respected even with
    snapshot=on, and in the case of committing changes, the final flush is
    no longer ignored except explicitly requested by the user.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Loading