From: Stefan Hajnoczi <stefanha@redhat.com>
To: Evgeny Yakovlev <wrfsh@yandex-team.ru>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
yc-core@yandex-team.ru, qemu-devel@nongnu.org,
qemu-block@nongnu.org, mst@redhat.com
Subject: Re: [RFC PATCH] virtio-blk: advertise F_WCE (F_FLUSH) if F_CONFIG_WCE is also advertised
Date: Wed, 9 Oct 2019 18:20:10 +0100 [thread overview]
Message-ID: <20191009172010.GC13568@stefanha-x1.localdomain> (raw)
In-Reply-To: <f7d2c01d-1676-f02c-e538-f924282eb6a5@yandex-team.ru>
[-- Attachment #1: Type: text/plain, Size: 2075 bytes --]
On Wed, Oct 09, 2019 at 03:37:35PM +0300, Evgeny Yakovlev wrote:
> On 08.10.2019 16:24, Stefan Hajnoczi wrote:
> > On Fri, Sep 20, 2019 at 02:56:30PM +0300, Evgeny Yakovlev wrote:
> > The motivation for this change looks correct but this patch may cause
> > host_features to change across live migration to a newer QEMU version.
> > If the guest accesses VIRTIO_PCI_HOST_FEATURES before and after live
> > migration it may see different values, which is unexpected.
> >
> > The safe way of introducing guest-visible changes like this is to make
> > the change conditional on the machine type version so that old guests
> > see old behavior and new guests see new behavior.
> >
> > Live migration compatibility can be guaranteed by adding a new property
> > to virtio_blk_properties[]:
> >
> > DEFINE_PROP_BOOL("enable-wce-if-config-wce", VirtIOBlock,
> > conf.enable_wce_if_config_wce, true),
> >
> > Then tweak the patch:
> >
> > if (blk_enable_write_cache(s->blk) ||
> > (s->conf.enable_wce_if_config_wce &&
> > virtio_has_feature(features, VIRTIO_BLK_F_CONFIG_WCE))) {
> >
> > And finally disable enable_wce_if_config_wce for older machine types to
> > retain compatibility:
> >
> > GlobalProperty hw_compat_4_2[] = {
> > { "virtio-blk-device", "enable-wce-if-config-wce", "off" },
> > };
> >
> > (I have omitted some steps like defining
> > VirtIOBlkConf.enable_wce_if_config_wce field and hooking up
> > hw_compat_4_2[], but you can figure that out from the existing code.)
>
>
> Why don't we just migrate host_features? That will ensure they are the same.
> And messing up device config on destination is bad anyway.
Traditionally QEMU has not migrated host state/objects. Instead it
relies on the destination QEMU command-line producing exactly the same
host state as on the source host.
A problem with migration host state is that it's impossible to offer
host features that are unavailable on the destination host (they cannot
be "migrated").
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-10-09 20:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 11:56 [RFC PATCH] virtio-blk: advertise F_WCE (F_FLUSH) if F_CONFIG_WCE is also advertised Evgeny Yakovlev
2019-10-08 13:24 ` Stefan Hajnoczi
2019-10-09 12:37 ` Evgeny Yakovlev
2019-10-09 17:20 ` Stefan Hajnoczi [this message]
2019-10-09 19:14 ` Michael S. Tsirkin
2019-10-10 11:52 ` Evgeny Yakovlev
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=20191009172010.GC13568@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=wrfsh@yandex-team.ru \
--cc=yc-core@yandex-team.ru \
/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).