From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjoW2-0004mN-JK for qemu-devel@nongnu.org; Fri, 22 Nov 2013 06:03:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjoVx-0007hP-7N for qemu-devel@nongnu.org; Fri, 22 Nov 2013 06:03:14 -0500 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:48220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjoVx-0007hG-0K for qemu-devel@nongnu.org; Fri, 22 Nov 2013 06:03:09 -0500 Received: by mail-wi0-f175.google.com with SMTP id hi5so536744wib.2 for ; Fri, 22 Nov 2013 03:03:08 -0800 (PST) Date: Fri, 22 Nov 2013 12:03:05 +0100 From: Stefan Hajnoczi Message-ID: <20131122110305.GF24388@stefanha-thinkpad.redhat.com> References: <1385085951-12729-1-git-send-email-vyasevic@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385085951-12729-1-git-send-email-vyasevic@redhat.com> Subject: Re: [Qemu-devel] [PATCH] net: Update netdev peer on link change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vlad Yasevich Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On Thu, Nov 21, 2013 at 09:05:51PM -0500, Vlad Yasevich wrote: > When a link change occurs on a backend (like tap), we currently do > not propage such change to the nic. As a result, when someone turns > off a link on a tap device, for instance, then a guest doesn't see > that change and continues to try to send traffic or run DHCP even > though the lower-layer is disconnected. This is OK when the network > is set up as a HUB since the the guest may be connected to other HUB > ports too, but when it's set up as a netdev, it makes thinkgs worse. > > The patch addresses this by setting the peers link down only when the > peer is not a HUBPORT device. With this patch, in the following config > -netdev tap,id=net0 -device e1000,mac=XXXXX,netdev=net0 > when net0 link is turned off, the guest e1000 shows lower-layer link > down. This allows guests to boot much faster in such configurations. > With windows guest, it also allows the network to recover properly > since windows will not configure the link-local IPv4 address, and > when the link is turned on, the proper address address is configured. > > Signed-off-by: Vlad Yasevich > --- > net/net.c | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) Merged for QEMU 1.8. Link state changes can lead to weird bugs so I don't want to rush this into QEMU 1.7. Thanks, applied to my net-next tree: https://github.com/stefanha/qemu/commits/net-next Stefan