[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest offloads after migration |
Date: |
Wed, 16 Sep 2015 17:55:11 +0200 |
On Fri, 11 Sep 2015 10:30:21 +0200
Cornelia Huck <address@hidden> wrote:
> On Fri, 11 Sep 2015 16:01:56 +0800
> Jason Wang <address@hidden> 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: address@hidden
> > Cc: Gerd Hoffmann <address@hidden>
> > Signed-off-by: Jason Wang <address@hidden>
> > ---
> > 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 ?
Re: [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest offloads after migration, Greg Kurz, 2015/09/16