[PATCH 16/17] virtio-net: Make save/load format independent of build options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alex Williamson <alex.williamson@xxxxxx>

We can't rely on build switches to tell us if a save image
includes a given field.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 27620ba..2da4c47 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -616,6 +616,8 @@ static void virtio_net_save(QEMUFile *f, void *opaque)
 
 #ifdef TAP_VNET_HDR
     qemu_put_be32(f, tap_has_vnet_hdr(n->vc->vlan->first_client));
+#else
+    qemu_put_be32(f, 0);
 #endif
 }
 
@@ -660,6 +662,9 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
     if (version_id == 7 && qemu_get_be32(f)) {
         tap_using_vnet_hdr(n->vc->vlan->first_client, 1);
     }
+#else
+    /* FIXME: error out if nonzero? */
+    qemu_get_be32(f);
 #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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux