From patchwork Sat May 23 01:02:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Josh Wilsdon X-Patchwork-Id: 25505 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4N1BLQB015321 for ; Sat, 23 May 2009 01:11:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758035AbZEWBLQ (ORCPT ); Fri, 22 May 2009 21:11:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758122AbZEWBLQ (ORCPT ); Fri, 22 May 2009 21:11:16 -0400 Received: from mail-qy0-f122.google.com ([209.85.221.122]:43667 "EHLO mail-qy0-f122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755129AbZEWBLP convert rfc822-to-8bit (ORCPT ); Fri, 22 May 2009 21:11:15 -0400 X-Greylist: delayed 500 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 May 2009 21:11:15 EDT Received: by qyk28 with SMTP id 28so1218502qyk.33 for ; Fri, 22 May 2009 18:11:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.2.79 with SMTP id 15mr4572699qai.256.1243040575096; Fri, 22 May 2009 18:02:55 -0700 (PDT) Date: Fri, 22 May 2009 18:02:54 -0700 Message-ID: <162a833f0905221802u7e0ad40r88915be927bdc5d2@mail.gmail.com> Subject: BUG REPORT: -net tap,fd=X does not work correctly in kvm-86 From: Josh Wilsdon To: kvm@vger.kernel.org Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We are doing work with libvirt 0.6.3 through which we have started virtual machines.  Using the same "create" command with the same storage, the same everything else this configuration works with both kvm-84 and kvm-85.  When I built a fresh version of kvm-86 this stopped working with an error: qemu: invalid parameter '15' in 'fd=15,script=,vlan=0,ifname=vnet0' The full execve() being used in this case by libvirtd is: execve("/usr/bin/kvm", ["/usr/bin/kvm", "-S", "-M", "pc", "-m", "512", "-smp", "1", "-name", "ubuntu-vm", "-uuid", "2100444e-4f16-f9f4-a6df-b6cac95c55b5", "-monitor", "pty", "-pidfile", "/var/run/libvirt/qemu//ubuntu-vm.pid", "-boot", "c", "-drive", "file=/dev/disk/by-path/ip-192.168.50.3:3260-iscsi-iqn.1986-03.com.sun:02:3985d229-59f7-e8a6-ff10-e0a68cf3567f-lun-0,if=virtio,index=0,boot=on", "-drive", "file=,if=virtio,media=cdrom,index=2", "-net", "nic,macaddr=54:52:00:27:36:cd,vlan=0,model=virtio", "-net", "tap,fd=15,script=,vlan=0,ifname=vnet0", "-serial", "pty", "-parallel", "none", "-usb", "-vnc", "127.0.0.1:0", "-k", "en-us"], [/* 5 vars */]) = 0 I took a quick look at the code and found this section which changed between kvm-85 and kvm-86:              } When I comment out the check: + if (check_params(fd_params, p) < 0) { + fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n", + buf, p); + return -1; + } after the first get_param_value this command line works again (though it seems the networking may not). Thanks, Josh --- Josh Wilsdon LayerBoom Systems joshw@layerboom.com http://layerboom.com -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- kvm-85/kvm/net.c 2009-04-21 02:57:31.000000000 -0700 +++ kvm-86/net.c 2009-05-19 09:29:02.000000000 -0700 @@ -1887,13 +2100,24 @@          int fd;          vlan->nb_host_devs++;          if (get_param_value(buf, sizeof(buf), "fd", p) > 0) { +            if (check_params(fd_params, p) < 0) { +                fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n", +                        buf, p); +                return -1; +            }              fd = strtol(buf, NULL, 0);              fcntl(fd, F_SETFL, O_NONBLOCK); -            ret = -1; -                if (net_tap_fd_init(vlan, device, name, fd, -                                    tap_probe_vnet_hdr(fd))) -                ret = 0; +                net_tap_fd_init(vlan, device, name, fd, tap_probe_vnet_hdr(fd)); +            ret = 0;          } else { +            static const char * const tap_params[] = { +                "vlan", "name", "ifname", "script", "downscript", NULL +            }; +            if (check_params(tap_params, p) < 0) { +                fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n", +                        buf, p); +                return -1; +            }              if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {                  ifname[0] = '\0';