From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: persistent tun & different virtual NICs & dead guest network Date: Sun, 05 Apr 2009 15:12:04 +0300 Message-ID: <49D8A014.7010802@redhat.com> References: <49D735D6.3070803@msgid.tls.msk.ru> <49D89CF8.8040200@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060905040407050705090109" Cc: KVM list , qemu-devel To: Michael Tokarev Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36203 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065AbZDEMML (ORCPT ); Sun, 5 Apr 2009 08:12:11 -0400 In-Reply-To: <49D89CF8.8040200@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------060905040407050705090109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Avi Kivity wrote: >> I think all the settings should be reset to 0 >> when opening the tun device. > > This should definitely be fixed. I'll look at writing a patch. > Okay, that's not in upstream qemu, so I committed a fix to kvm-userspace.git. Attached if you want to test it. -- error compiling committee.c: too many arguments to function --------------060905040407050705090109 Content-Type: text/x-patch; name="0001-kvm-qemu-clear-tap-features-on-initialization.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-kvm-qemu-clear-tap-features-on-initialization.patch" >>From 25971710409c374e9486c960c297f324a9164a65 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 5 Apr 2009 15:08:55 +0300 Subject: [PATCH] kvm: qemu: clear tap features on initialization tap features change how tap interprets data, so they must be cleared on initialization to prevent old settings from interfering with new guest instances. Signed-off-by: Avi Kivity --- qemu/net.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/net.c b/qemu/net.c index d753fa0..703d01c 100644 --- a/qemu/net.c +++ b/qemu/net.c @@ -930,6 +930,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan, #endif #ifdef TUNSETOFFLOAD s->vc->set_offload = tap_set_offload; + tap_set_offload(s->vc, 0, 0, 0, 0); #endif qemu_set_fd_handler2(s->fd, tap_can_send, tap_send, NULL, s); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "fd=%d", fd); -- 1.6.0.6 --------------060905040407050705090109-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqRCu-0000kU-W1 for qemu-devel@nongnu.org; Sun, 05 Apr 2009 08:12:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqRCp-0000jv-FZ for qemu-devel@nongnu.org; Sun, 05 Apr 2009 08:12:11 -0400 Received: from [199.232.76.173] (port=39463 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqRCp-0000jo-4E for qemu-devel@nongnu.org; Sun, 05 Apr 2009 08:12:07 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56429) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LqRCo-00046A-MC for qemu-devel@nongnu.org; Sun, 05 Apr 2009 08:12:06 -0400 Message-ID: <49D8A014.7010802@redhat.com> Date: Sun, 05 Apr 2009 15:12:04 +0300 From: Avi Kivity MIME-Version: 1.0 References: <49D735D6.3070803@msgid.tls.msk.ru> <49D89CF8.8040200@redhat.com> In-Reply-To: <49D89CF8.8040200@redhat.com> Content-Type: multipart/mixed; boundary="------------060905040407050705090109" Subject: [Qemu-devel] Re: persistent tun & different virtual NICs & dead guest network Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-devel , KVM list This is a multi-part message in MIME format. --------------060905040407050705090109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Avi Kivity wrote: >> I think all the settings should be reset to 0 >> when opening the tun device. > > This should definitely be fixed. I'll look at writing a patch. > Okay, that's not in upstream qemu, so I committed a fix to kvm-userspace.git. Attached if you want to test it. -- error compiling committee.c: too many arguments to function --------------060905040407050705090109 Content-Type: text/x-patch; name="0001-kvm-qemu-clear-tap-features-on-initialization.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-kvm-qemu-clear-tap-features-on-initialization.patch" >>From 25971710409c374e9486c960c297f324a9164a65 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 5 Apr 2009 15:08:55 +0300 Subject: [PATCH] kvm: qemu: clear tap features on initialization tap features change how tap interprets data, so they must be cleared on initialization to prevent old settings from interfering with new guest instances. Signed-off-by: Avi Kivity --- qemu/net.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/net.c b/qemu/net.c index d753fa0..703d01c 100644 --- a/qemu/net.c +++ b/qemu/net.c @@ -930,6 +930,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan, #endif #ifdef TUNSETOFFLOAD s->vc->set_offload = tap_set_offload; + tap_set_offload(s->vc, 0, 0, 0, 0); #endif qemu_set_fd_handler2(s->fd, tap_can_send, tap_send, NULL, s); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "fd=%d", fd); -- 1.6.0.6 --------------060905040407050705090109--