From: Jamie Lokier <jamie@shareable.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Avi Kivity <avi@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] bs->enable_write_cache and the guest ABI
Date: Mon, 8 Mar 2010 22:55:42 +0000 [thread overview]
Message-ID: <20100308225542.GB16057@shareable.org> (raw)
In-Reply-To: <20100308170042.GA16826@lst.de>
Christoph Hellwig wrote:
> On Mon, Mar 08, 2010 at 09:47:32AM +0000, Jamie Lokier wrote:
> > Assuming the outcome is that it becomes a qdev property, and stays
> > preserved across migrations, even if the backing device access
> > changes, then I think the right thing is to dynamically decide to set
> > O_DSYNC and/or call fdatasync before completing writes from qemu when
> > the guest thinks enable_write_cache=0 (or sets it to 0). With
> > cache=none, that would set O_DSYNC|O_DIRECT if the two flags do work
> > properly together on our favourite hosts.
> >
> > Thus enable_write_cache won't always have the default value for the
> > different backing device access type, but it will match the guest's
> > expectations and be actually safe. Moreover more, by responding to
> > the guest changing that, it's closer to behaving like real harware.
>
> I'd have to look at other uses of qdev, but I would assume that we
> always look at the qdev properties and only use the existing drive
> suboptions as compatiblity if we do not have the qdev properties set.
I'm not sure if I was clear or not: I mean if the guest runs "hdparm
-W $value" or Windows equivalent, and cache!=writethrough, it should
have the effect of turning on/off the host's O_DSYNC flag (or qemu
calling fdatasync() before signalling every write completion), because
that's really just another way for the guest say it wants to flush
write caches after every write. So that's what the emulation should
do, either explicitly (fdatasync) or a subtler way (O_DSYNC).
That guest-visible flag, which is part of the emulated drive state,
should be preserved across migration.
-- Jamie
next prev parent reply other threads:[~2010-03-08 23:07 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 [this message]
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
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=20100308225542.GB16057@shareable.org \
--to=jamie@shareable.org \
--cc=avi@redhat.com \
--cc=hch@lst.de \
--cc=qemu-devel@nongnu.org \
/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 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).