@@ -360,19 +360,30 @@ static void virtio_net_save(QEMUFile *f, void *opaque)
qemu_put_buffer(f, n->mac, 6);
qemu_put_be32(f, n->tx_timer_active);
+ qemu_put_be32(f, n->mergeable_rx_bufs);
+
+#ifdef TAP_VNET_HDR
+ qemu_put_be32(f, tap_has_vnet_hdr(n->vc->vlan->first_client));
+#endif
}
static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIONet *n = opaque;
- if (version_id != 1)
+ if (version_id != 2)
return -EINVAL;
virtio_load(&n->vdev, f);
qemu_get_buffer(f, n->mac, 6);
n->tx_timer_active = qemu_get_be32(f);
+ n->mergeable_rx_bufs = qemu_get_be32(f);
+
+#ifdef TAP_VNET_HDR
+ if (qemu_get_be32(f))
+ tap_using_vnet_hdr(n->vc->vlan->first_client, 1);
+#endif
if (n->tx_timer_active) {
qemu_mod_timer(n->tx_timer,
@@ -407,7 +418,7 @@ PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
n->tx_timer_active = 0;
n->mergeable_rx_bufs = 0;
- register_savevm("virtio-net", virtio_net_id++, 1,
+ register_savevm("virtio-net", virtio_net_id++, 2,
virtio_net_save, virtio_net_load, n);
return (PCIDevice *)n;