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


-    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


Reply via email to