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

[Xen-changelog] [qemu-upstream-unstable] tap: reset vnet header size on open



commit 58ddcd50f30cb5c020bd4f9f36b01ee160a27cac
Author: Michael S. Tsirkin <mst@xxxxxxxxxx>
Date:   Tue Nov 13 12:23:23 2012 +0200

    tap: reset vnet header size on open
    
    For tap, we currently assume the vnet header size is 10
    (the default value) but that might not be the case
    if tap is persistent and has been used by qemu previously.
    To fix, set host header size in tap device on open.
    
    Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Tested-by: Alexander Graf <agraf@xxxxxxx>
    Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
---
 net/tap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index df89caa..1abfd44 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -341,6 +341,13 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
     s->using_vnet_hdr = 0;
     s->has_ufo = tap_probe_has_ufo(s->fd);
     tap_set_offload(&s->nc, 0, 0, 0, 0, 0);
+    /*
+     * Make sure host header length is set correctly in tap:
+     * it might have been modified by another instance of qemu.
+     */
+    if (tap_probe_vnet_hdr_len(s->fd, s->host_vnet_hdr_len)) {
+        tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
+    }
     tap_read_poll(s, 1);
     s->vhost_net = NULL;
     return s;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.