On Thu, Mar 17, 2011 at 9:07 AM, Kevin Wolf <kw...@redhat.com> wrote: > Am 16.03.2011 18:00, schrieb Stefan Hajnoczi: >> On Wed, Mar 16, 2011 at 2:08 PM, Christoph Hellwig <h...@lst.de> wrote: >>> On Wed, Mar 16, 2011 at 09:42:37AM +0000, Stefan Hajnoczi wrote: >>>> - writethrough = ((flags & BDRV_O_CACHE_MASK) == 0); >>>> + writethrough = ((flags & (BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH)) == 0); >>> >>> or rather >>> >>> writethrough = ((flags & (BDRV_O_CACHE_WB) != ); >>> >>> but yes, this code had sneaked in since my initial version. >> >> My intention was that if we don't care about honoring flushes then we >> might as well use Qcow2Cache. But yes, just checking for cache mode >> is the clearest. > > You mean for a possible writethrough mode with BDRV_O_NO_FLUSH set? Such > a mode doesn't make a lot of sense to me.
Yeah, I guess you're right, we can never have BDRV_O_NO_FLUSH without BDRV_O_CACHE_WB today. I wasn't thinking end-to-end, just looking at the BDRV_O_* flag bits. Stefan