From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcF3O-00058i-3s for qemu-devel@nongnu.org; Wed, 16 Sep 2015 11:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcF3I-0002TB-HB for qemu-devel@nongnu.org; Wed, 16 Sep 2015 11:55:26 -0400 Received: from e06smtp05.uk.ibm.com ([195.75.94.101]:59783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcF3I-0002T0-2j for qemu-devel@nongnu.org; Wed, 16 Sep 2015 11:55:20 -0400 Received: from /spool/local by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Sep 2015 16:55:18 +0100 Date: Wed, 16 Sep 2015 17:55:11 +0200 From: Greg Kurz Message-ID: <20150916175511.6328fceb@bahia.local> In-Reply-To: <20150911103021.19f73181.cornelia.huck@de.ibm.com> References: <1441958516-21107-1-git-send-email-jasowang@redhat.com> <20150911103021.19f73181.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-net: unbreak self announcement and guest offloads after migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, Jason Wang , mst@redhat.com, qemu-stable@nongnu.org, Gerd Hoffmann On Fri, 11 Sep 2015 10:30:21 +0200 Cornelia Huck wrote: > On Fri, 11 Sep 2015 16:01:56 +0800 > Jason Wang 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 > > Signed-off-by: Jason Wang > > --- > > 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 ?