All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, Christoph Hellwig <hch@lst.de>
Subject: [Qemu-devel] Re: bs->enable_write_cache and the guest ABI
Date: Mon, 08 Mar 2010 12:48:42 +0200	[thread overview]
Message-ID: <4B94D60A.7070006@redhat.com> (raw)
In-Reply-To: <m3vdd7yulg.fsf@trasno.mitica>

On 03/08/2010 12:29 PM, Juan Quintela wrote:
> Avi Kivity<avi@redhat.com>  wrote:
>    
>> 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.
>>      
> For RHEL I setted with adding enable_write_cache to the migration
> state.  As you state, that value is guest visible.  I can update that
> patches to qemu.  When I migrated from an old version, I just set that
> value to 0.
>
> What do you think?
>    

I think we have to go with a qdev property as Christoph suggests.  Then 
it becomes the management's responsibility to set it right.

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

  reply	other threads:[~2010-03-08 10:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B94D60A.7070006@redhat.com \
    --to=avi@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.