Skip to content
  • Christoph Hellwig's avatar
    block: add enable_write_cache flag · e900a7b7
    Christoph Hellwig authored
    
    
    Add a enable_write_cache flag in the block driver state, and use it to
    decide if we claim to have a volatile write cache that needs controlled
    flushing from the guest.  The flag is off if cache=writethrough is
    defined because O_DSYNC guarantees that every write goes to stable
    storage, and it is on for cache=none and cache=writeback.
    
    Both scsi-disk and ide now use the new flage, changing from their
    defaults of always off (ide) or always on (scsi-disk).
    
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    e900a7b7