From patchwork Wed May 6 16:01:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 22069 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n46G1MoI013346 for ; Wed, 6 May 2009 16:01:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754666AbZEFQBR (ORCPT ); Wed, 6 May 2009 12:01:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755376AbZEFQBR (ORCPT ); Wed, 6 May 2009 12:01:17 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:7189 "EHLO g1t0027.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754230AbZEFQBQ (ORCPT ); Wed, 6 May 2009 12:01:16 -0400 Received: from g1t0038.austin.hp.com (g1t0038.austin.hp.com [16.236.32.44]) by g1t0027.austin.hp.com (Postfix) with ESMTP id BE76738125; Wed, 6 May 2009 16:01:17 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g1t0038.austin.hp.com (Postfix) with ESMTP id A8FD53006E; Wed, 6 May 2009 16:01:17 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 5599239C074; Wed, 6 May 2009 10:01:17 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LYVNXSSUoKe4; Wed, 6 May 2009 10:01:16 -0600 (MDT) Received: from [10.91.73.10] (lart.fc.hp.com [15.11.146.31]) by ldl.fc.hp.com (Postfix) with ESMTP id E7CFB39C007; Wed, 6 May 2009 10:01:15 -0600 (MDT) Subject: Re: [PATCH] virtio-net: Fix save/load From: Alex Williamson To: Avi Kivity Cc: kvm-devel , Mark McLoughlin In-Reply-To: <4A013A75.9050405@redhat.com> References: <1232042731.20605.9.camel@bling> <4A013A75.9050405@redhat.com> Organization: OSLO R&D Date: Wed, 06 May 2009 10:01:15 -0600 Message-Id: <1241625675.26045.42.camel@lappy> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 2009-05-06 at 10:21 +0300, Avi Kivity wrote: > Alex Williamson wrote: > > We can't rely on build switches to tell us if a save image > > includes a given field. We also need to save status since > > it's visible to the guest. Draw another line in the sand > > for broken save versions. The version number should always > > be updated when new values are saved and load should make > > an attempt to set reasonable defaults for lower version save > > images. > > > > I applied the the first part of this ancient patch. Can't tell from the > thread what the consensus is for the rest. Thanks Avi, I think you got the important bits. I might recommend the following change to keep this contained to a version_id 7 load and bail if vnet header support is required, but not available. Thanks, Alex kvm: virtio-net: Cleanup load from vnet header saved image Bail if the saved image requires vnet header support. Signed-off-by: Alex Williamson --- hw/virtio-net.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 6dfe758..4beb16d 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -663,14 +663,15 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) if (version_id >= 6) qemu_get_buffer(f, (uint8_t *)n->vlans, MAX_VLAN >> 3); -#ifdef TAP_VNET_HDR if (version_id == 7 && qemu_get_be32(f)) { +#ifdef TAP_VNET_HDR tap_using_vnet_hdr(n->vc->vlan->first_client, 1); - } #else - /* FIXME: error out if nonzero? */ - qemu_get_be32(f); + fprintf(stderr, + "virtio-net: saved image requires vnet header support\n"); + exit(1); #endif + } if (n->tx_timer_active) { qemu_mod_timer(n->tx_timer,