qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] bs->enable_write_cache and the guest ABI
@ 2010-03-07 14:42 Avi Kivity
  2010-03-08  9:39 ` Christoph Hellwig
  2010-03-08 10:29 ` [Qemu-devel] " Juan Quintela
  0 siblings, 2 replies; 12+ messages in thread
From: Avi Kivity @ 2010-03-07 14:42 UTC (permalink / raw)
  To: qemu-devel, Christoph Hellwig

block.c says:

>     /*
>      * 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;

This means that if I start a guest with cache=writethrough and then 
restart (or live migrate) it with cache=none, then the guest will see a 
change, even though the user only changed the drive's backing, not 
something guest visible.  In the case of live migration, the guest will 
not even notice the change and we may be at risk of data loss.

For 0.13 I propose setting enable_write_cache to true unconditionally.  
For 0.12 the question is more difficult, since we'll be changing the 
guest ABI.  Given that guests are unlikely not to be able to cope with 
write caches, and that the alternative is data loss, I believe that's 
also the right solution there.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-03-09 19:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-07 14:42 [Qemu-devel] bs->enable_write_cache and the guest ABI Avi Kivity
2010-03-08  9:39 ` Christoph Hellwig
2010-03-08  9:45   ` Avi Kivity
2010-03-08  9:47   ` Jamie Lokier
2010-03-08 17:00     ` Christoph Hellwig
2010-03-08 22:55       ` Jamie Lokier
2010-03-08 10:29 ` [Qemu-devel] " Juan Quintela
2010-03-08 10:48   ` Avi Kivity
2010-03-08 12:46     ` Juan Quintela
2010-03-08 23:00     ` Jamie Lokier
2010-03-09  9:56       ` Avi Kivity
2010-03-09 19:26         ` Jamie Lokier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).