From patchwork Wed Apr 29 20:53:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 20809 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 n3TKs2N0007298 for ; Wed, 29 Apr 2009 20:54:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754347AbZD2Ux4 (ORCPT ); Wed, 29 Apr 2009 16:53:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753849AbZD2Uxy (ORCPT ); Wed, 29 Apr 2009 16:53:54 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:54652 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753429AbZD2Uxx (ORCPT ); Wed, 29 Apr 2009 16:53:53 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3TKoMl1012515 for ; Wed, 29 Apr 2009 16:50:22 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3TKrrqF150360 for ; Wed, 29 Apr 2009 16:53:53 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3TKq3EP026497 for ; Wed, 29 Apr 2009 16:52:03 -0400 Received: from localhost.localdomain (sig-9-65-58-151.mts.ibm.com [9.65.58.151]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n3TKq1kZ026435; Wed, 29 Apr 2009 16:52:02 -0400 From: Anthony Liguori To: kvm@vger.kernel.org Cc: Anthony Liguori , Avi Kivity Subject: [PATCH 1/2] Increment virtio-net savevm version to avoid conflict with upstream QEMU. Date: Wed, 29 Apr 2009 15:53:49 -0500 Message-Id: <1241038430-7444-2-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1241038430-7444-1-git-send-email-aliguori@us.ibm.com> References: <1241038430-7444-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When TAP_VNET_HDR eventually merges into upstream QEMU, it cannot change the format of the version 6 savevm data. This means that we're going to have to bump the version up to 7. I'm happy to reserve version 7 as having TAP_VNET_HDR support to allow time to include this support in upstream QEMU. For those shipping products based on KVM though, it's important that we do not conflict with upstream QEMU versioning or else it's going to result in breakage of backwards compatibility. Signed-off-by: Anthony Liguori --- hw/virtio-net.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 5f5f2f3..ac8e030 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -21,7 +21,12 @@ #define TAP_VNET_HDR -#define VIRTIO_NET_VM_VERSION 6 +/* Version 7 has TAP_VNET_HDR support. This is reserved in upstream QEMU to + * avoid future conflict. + * We can't assume verisons > 7 have TAP_VNET_HDR support until this is merged + * in upstream QEMU. + */ +#define VIRTIO_NET_VM_VERSION 7 #define MAC_TABLE_ENTRIES 32 #define MAX_VLAN (1 << 12) /* Per 802.1Q definition */ @@ -652,8 +657,9 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) qemu_get_buffer(f, (uint8_t *)n->vlans, MAX_VLAN >> 3); #ifdef TAP_VNET_HDR - if (qemu_get_be32(f)) + if (version_id == 7 && qemu_get_be32(f)) { tap_using_vnet_hdr(n->vc->vlan->first_client, 1); + } #endif if (n->tx_timer_active) {