On Fri, Apr 22, 2011 at 04:08:57PM +1000, ronnie sahlberg wrote: > So I should set FUA when > BDRV_O_CACHE_WB==0 or BDRV_O_NOCACHE==1 > right?
At this point you need to set it if either the BDRV_O_CACHE_WB and BDRV_O_NOCACHE flags are set. And yes, the naming of the nocache flag is rather confusing. Take a look at block.c:bdrv_open_common(): /* * Yes, BDRV_O_NOCACHE aka O_DIRECT means we have to present a * write cache to the guest. We do need the fdatasync to flush * out transactions for block allocations, and we maybe have a * volatile write cache in our backing device to deal with. */ if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE)) bs->enable_write_cache = 1;