Message ID | 1241625675.26045.42.camel@lappy (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Alex Williamson wrote: > 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. > Thanks, applied. I even thought of this while applying the original patch but I guess my attention span is in a downward spiral so I forgot about it.
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,