From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbOyI-0008NI-G0 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 23:00:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbOyH-0003ik-5M for qemu-devel@nongnu.org; Thu, 15 Dec 2011 23:00:34 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:49529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbOyH-0003iV-09 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 23:00:33 -0500 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Dec 2011 21:00:31 -0700 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBG40QWl120144 for ; Thu, 15 Dec 2011 21:00:27 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBG40QU3004330 for ; Thu, 15 Dec 2011 21:00:26 -0700 Message-ID: <4EEAC258.6090002@linux.vnet.ibm.com> Date: Thu, 15 Dec 2011 23:00:24 -0500 From: Corey Bryant MIME-Version: 1.0 References: <1321242349-4140-1-git-send-email-coreyb@linux.vnet.ibm.com> <1321242349-4140-5-git-send-email-coreyb@linux.vnet.ibm.com> <4EEA11BF.1020405@us.ibm.com> In-Reply-To: <4EEA11BF.1020405@us.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v5 4/4] Add support for net bridge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: rmarwah@linux.vnet.ibm.com, qemu-devel@nongnu.org On 12/15/2011 10:26 AM, Anthony Liguori wrote: > On 11/13/2011 09:45 PM, Corey Bryant wrote: >> The most common use of -net tap is to connect a tap device to a >> bridge. This >> requires the use of a script and running qemu as root in order to >> allocate a >> tap device to pass to the script. > > This patch breaks the build: > > anthony@titi:~/build/qemu$ make > CC net/tap.o > cc1: warnings being treated as errors > /home/anthony/git/qemu/net/tap.c: In function ‘net_init_tap’: > /home/anthony/git/qemu/net/tap.c:560:15: error: ‘s’ may be used > uninitialized in this function > make: *** [net/tap.o] Error 1 > I was wondering how I missed this. I typically configure with --enable-debug, which appears to suppress warnings. >> >> - s = net_tap_fd_init(vlan, "tap", name, fd, vnet_hdr); >> - if (!s) { >> - close(fd); >> - return -1; >> + s = net_tap_fd_init(vlan, "tap", name, fd, vnet_hdr); >> + if (!s) { >> + close(fd); >> + return -1; >> + } >> } > > And indeed, you've changed the function from unconditionally > initializing s to conditionally initializing it. Specifically, you've > broken -net tap,fd=X which would break tools like libvirt. > > Regards, > > Anthony Liguori > > -- Regards, Corey