[PATCH 12/17] Increment virtio-net savevm version to avoid conflict with upstream QEMU.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Anthony Liguori
Date: Sunday, May 17, 2009 - 8:43 am

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 <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 09e4b89..27620ba 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) {
-- 
1.6.0.6

--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/17][REVIEW] Backport candidates for stable-0.10, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 05/17] Stop/start cpus before/after devices, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 06/17] Use statfs to determine size of huge pages, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 07/17] Fixup 4GB+ memslot large page alignment, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 08/17] Clear tap features on initialization, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 09/17] Propagate errors on failed migration., Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 12/17] Increment virtio-net savevm version to avoid ..., Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 13/17] Increment version id for CPU save state, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 14/17] Fix build when objdir != srcdir, Anthony Liguori, (Sun May 17, 8:43 am)
[PATCH 15/17] Fix loading extboot option rom, Anthony Liguori, (Sun May 17, 8:43 am)
Re: [PATCH 15/17] Fix loading extboot option rom, Avi Kivity, (Sun May 17, 10:06 am)
Re: [PATCH 0/17][REVIEW] Backport candidates for stable-0.10, Anthony Liguori, (Sun May 17, 4:32 pm)
Re: [PATCH 0/17][REVIEW] Backport candidates for stable-0.10, Anthony Liguori, (Sun May 17, 4:36 pm)
Re: [PATCH 06/17] Use statfs to determine size of huge pages, Anthony Liguori, (Mon May 18, 6:10 am)
Re: [PATCH 05/17] Stop/start cpus before/after devices, Marcelo Tosatti, (Mon May 18, 6:58 am)
Re: [PATCH 05/17] Stop/start cpus before/after devices, Anthony Liguori, (Mon May 18, 7:26 am)
Re: [PATCH 05/17] Stop/start cpus before/after devices, Marcelo Tosatti, (Mon May 18, 7:47 am)
Re: [PATCH 11/17] net: drop packet from tap device if all ..., Mark McLoughlin, (Tue May 19, 10:52 am)