qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>,
	mst@redhat.com, qemu-stable@nongnu.org,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest offloads after migration
Date: Wed, 16 Sep 2015 17:55:11 +0200	[thread overview]
Message-ID: <20150916175511.6328fceb@bahia.local> (raw)
In-Reply-To: <20150911103021.19f73181.cornelia.huck@de.ibm.com>

On Fri, 11 Sep 2015 10:30:21 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:

> On Fri, 11 Sep 2015 16:01:56 +0800
> Jason Wang <jasowang@redhat.com> wrote:
> 
> > After commit 019a3edbb25f1571e876f8af1ce4c55412939e5d ("virtio: make
> > features 64bit wide"). Device's guest_features was actually set after
> > vdc->load(). This breaks the assumption that device specific load()
> > function can check guest_features. For virtio-net, self announcement
> > and guest offloads won't work after migration.
> > 
> > Fixing this by defer them to virtio_net_load() where guest_features
> > were guaranteed to be set. Other virtio devices looks fine.
> > 
> > Fixes: 019a3edbb25f1571e876f8af1ce4c55412939e5d
> >        ("virtio: make features 64bit wide")
> > Cc: qemu-stable@nongnu.org
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> >  hw/net/virtio-net.c | 40 +++++++++++++++++++++++-----------------
> >  1 file changed, 23 insertions(+), 17 deletions(-)
> 
> Migration support for virtio is really a twisty maze, it's easy to make
> mistakes like that :(
> 

We have the very same problem with @device_endian which is also streamed in
a subsection. To prevent early usage on the load path, we set @device_endian
to a poisoned value that triggers assert() in the virtio_is_big_endian() helper.

Should this logic be generalized ?

  reply	other threads:[~2015-09-16 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11  8:01 [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest offloads after migration Jason Wang
2015-09-11  8:30 ` Cornelia Huck
2015-09-16 15:55   ` Greg Kurz [this message]
2015-09-17  9:06     ` [Qemu-devel] [PATCH] virtio: add some migration doc Cornelia Huck
2015-09-17 10:39       ` Greg Kurz
2015-09-17 10:47         ` Jason Wang
2015-09-17 10:47         ` Cornelia Huck
2015-09-17 10:44       ` Jason Wang
2015-09-17 10:49         ` Cornelia Huck
2015-09-17 15:42       ` Eric Blake
2015-09-16 15:54 ` [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest offloads after migration Greg Kurz

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=20150916175511.6328fceb@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).