qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 4/4] Add support for net bridge


From: Corey Bryant
Subject: Re: [Qemu-devel] [PATCH v5 4/4] Add support for net bridge
Date: Thu, 15 Dec 2011 23:00:24 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9



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:

address@hidden:~/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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]