From patchwork Mon Jun 22 10:26:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 487136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id ADC40140157 for ; Mon, 22 Jun 2015 20:27:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Jf87elE9; dkim-atps=neutral Received: from localhost ([::1]:39157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6ywU-00032Y-EB for incoming@patchwork.ozlabs.org; Mon, 22 Jun 2015 06:27:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6ywA-0002jC-68 for qemu-devel@nongnu.org; Mon, 22 Jun 2015 06:26:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6yw6-0006ot-0J for qemu-devel@nongnu.org; Mon, 22 Jun 2015 06:26:46 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:34241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6yw5-0006ol-BE for qemu-devel@nongnu.org; Mon, 22 Jun 2015 06:26:41 -0400 Received: by wicnd19 with SMTP id nd19so71951601wic.1 for ; Mon, 22 Jun 2015 03:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=CXr2Jme+PogHPZaFgmBIKmWA8n+p0Og+aqQhhFzPLi4=; b=Jf87elE9warnEEqTb5kt8maNnMXf2u1WywpYP0N9LYIIatV0ixZxlSZoFpgJ/oaMeo dQyxXn4jFMzuH9DD+XfA17Xxzd1DafKHdXjHHnAdML4hfb2rc+HiKQ8y9+XtDObrjFcK 1HLr0bHdFgoPH+okCm6piaCruqD/V7+i3mbRgCIYs2pzvHBwhyAtVuijJc6CgvHqri1J vzIRovpiwvk0X8JbXoKq3PO0BfuM4eaXuLPxR/2n4HpJE7lW9e26v4CizNWpOjV0OWsI B/jfRHjNON6OQrxiiid1wY+gCVMoKVZGEMs7zkalx8P7+iQs65rQ/0JaVWWREn7+zTQ0 w/QQ== X-Received: by 10.194.77.211 with SMTP id u19mr47746085wjw.19.1434968800763; Mon, 22 Jun 2015 03:26:40 -0700 (PDT) Received: from localhost (host86-186-232-168.range86-186.btcentralplus.com. [86.186.232.168]) by mx.google.com with ESMTPSA id i5sm16538371wic.10.2015.06.22.03.26.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 03:26:39 -0700 (PDT) Date: Mon, 22 Jun 2015 11:26:38 +0100 From: Stefan Hajnoczi To: Bug 1467240 <1467240@bugs.launchpad.net> Message-ID: <20150622102638.GF20966@stefanha-thinkpad.redhat.com> References: <20150621112608.24532.97250.malonedeb@gac.canonical.com> <20150621112608.24532.97250.malonedeb@gac.canonical.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150621112608.24532.97250.malonedeb@gac.canonical.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [Bug 1467240] [NEW] Regression - bridged networking broken for Mac OS X guest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Sun, Jun 21, 2015 at 11:26:08AM -0000, Jonathan Liu wrote: > Using the instructions at > http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/ for running Mac OS X > Snow Leopard under QEMU, bridged networking is broken when using QEMU > git. The result is that Mac OS X is unable to obtain an IP address using > DHCP. It works in the latest stable release - QEMU 2.3.0. > > Replace "-netdev user,id=hub0port0" with "-netdev > bridge,br=br0,id=hub0port0" when testing bridged networking. > > Bisecting the git repository shows the following bad commit: > commit a90a7425cf592a3afeff3eaf32f543b83050ee5c > Author: Fam Zheng > Date: Thu Jun 4 14:45:17 2015 +0800 > > tap: Drop tap_can_send Please confirm that you are using -device e1000-82545em. Please try the following patch to gather debug output: diff --git a/hw/net/e1000.c b/hw/net/e1000.c index bab8e2a..2f68c6d 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -174,6 +174,7 @@ enum { static void e1000_link_down(E1000State *s) { + fprintf(stderr, "%s link down\n", __func__); s->mac_reg[STATUS] &= ~E1000_STATUS_LU; s->phy_reg[PHY_STATUS] &= ~MII_SR_LINK_STATUS; s->phy_reg[PHY_STATUS] &= ~MII_SR_AUTONEG_COMPLETE; @@ -183,6 +184,7 @@ e1000_link_down(E1000State *s) static void e1000_link_up(E1000State *s) { + fprintf(stderr, "%s link up\n", __func__); s->mac_reg[STATUS] |= E1000_STATUS_LU; s->phy_reg[PHY_STATUS] |= MII_SR_LINK_STATUS; } @@ -923,6 +925,12 @@ e1000_can_receive(NetClientState *nc) { E1000State *s = qemu_get_nic_opaque(nc); + fprintf(stderr, "%s lu %d rctl_en %d pci_master %d has_rxbufs %d\n", + __func__, s->mac_reg[STATUS] & E1000_STATUS_LU, + s->mac_reg[RCTL] & E1000_RCTL_EN, + s->parent_obj.config[PCI_COMMAND] & PCI_COMMAND_MASTER, + e1000_has_rxbufs(s, 1)); + return (s->mac_reg[STATUS] & E1000_STATUS_LU) && (s->mac_reg[RCTL] & E1000_RCTL_EN) && (s->parent_obj.config[PCI_COMMAND] & PCI_COMMAND_MASTER) && diff --git a/net/tap.c b/net/tap.c index bd01590..07676ce 100644 --- a/net/tap.c +++ b/net/tap.c @@ -67,6 +67,8 @@ static void tap_writable(void *opaque); static void tap_update_fd_handler(TAPState *s) { + fprintf(stderr, "%s read_poll %d write_poll %d enabled %d\n", + __func__, s->read_poll, s->write_poll, s->enabled); qemu_set_fd_handler(s->fd, s->read_poll && s->enabled ? tap_send : NULL, s->write_poll && s->enabled ? tap_writable : NULL,