1. 01 May, 2012 2 commits
    • Nikolaus Rath's avatar
      Declare state directory in smb.conf · 276eda57
      Nikolaus Rath authored
      The smb.conf generated by the userspace networking does not include a state directory
      directive. Samba therefore falls back to the default value. Since the user generally
      does not have write access to this path, smbd immediately crashes.
      The "state directory" option was added in Samba 3.4.0 (commit
      This patch adds the missing option.
      Signed-off-by: default avatarNikolaus Rath <Nikolaus@rath.org>
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    • Nikolaus Rath's avatar
      slirp: don't use "smb ports = 0" option · de305b13
      Nikolaus Rath authored
      The "smb ports = 0" option causes recent samba versions to crash. It was
      introduced in commit 157777ef with log message "Samba 3 support".
      However, a value of 0 has never been officially supported by smb and is
      also not necessary: if stdin is a socket, smb does not try to listen on
      any ports and uses just stdin. This is necessary to support inetd based
      operation (otherwise smbd would always fail when called from inetd,
      because inetd already listens on the SMB port). Since samba has
      supported inetd operation since pre-3.x, it should be safe to rely on
      this feature. I have tested it with Samba 3.6.4 -- communication works
      fine, and smbd is not listening on any ports.
      I suspect the "smb ports = 0" hack may have been introduced when someone
      tested the qemu generated samba config from the command line with "smbd
      -i" and found it to fail (because then stdin isn't a socket).
      Signed-off-by: default avatarNikolaus Rath <Nikolaus@rath.org>
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
  2. 10 Feb, 2012 1 commit
  3. 01 Feb, 2012 2 commits
    • Stefan Weil's avatar
      Change license from GPLv2 to GPLv2+ · 4c32fe66
      Stefan Weil authored
      This file only contains code from Red Hat, so it can use GPLv2+.
      Tested with `git blame -M -C net/checksum.c`.
      Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    • Corey Bryant's avatar
      Add support for net bridge · a7c36ee4
      Corey Bryant authored
      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 model is great for portability and flexibility but it's incredibly
      difficult to eliminate the need to run qemu as root.  The only really viable
      mechanism is to use tunctl to create a tap device, attach it to a bridge as
      root, and then hand that tap device to qemu.  The problem with this mechanism
      is that it requires administrator intervention whenever a user wants to create
      a guest.
      By essentially writing a helper that implements the most common qemu-ifup
      script that can be safely given cap_net_admin, we can dramatically simplify
      things for non-privileged users.  We still support existing -net tap options
      as a mechanism for advanced users and backwards compatibility.
      Currently, this is very Linux centric but there's really no reason why it
      couldn't be extended for other Unixes.
      A typical invocation would be similar to one of the following:
        qemu linux.img -net bridge -net nic,model=virtio
        qemu linux.img -net tap,helper="/usr/local/libexec/qemu-bridge-helper"
                       -net nic,model=virtio
        qemu linux.img -netdev bridge,id=hn0
                       -device virtio-net-pci,netdev=hn0,id=nic1
        qemu linux.img -netdev tap,helper="/usr/local/libexec/qemu-bridge-helper",id=hn0
                       -device virtio-net-pci,netdev=hn0,id=nic1
      The default bridge that we attach to is br0.  The thinking is that a distro
      could preconfigure such an interface to allow out-of-the-box bridged networking.
      Alternatively, if a user wants to use a different bridge, a typical invocation
      would be simliar to one of the following:
        qemu linux.img -net bridge,br=qemubr0 -net nic,model=virtio
        qemu linux.img -net tap,helper="/usr/local/libexec/qemu-bridge-helper --br=qemubr0"
                       -net nic,model=virtio
        qemu linux.img -netdev bridge,br=qemubr0,id=hn0
                       -device virtio-net-pci,netdev=hn0,id=nic1
        qemu linux.img -netdev tap,helper="/usr/local/libexec/qemu-bridge-helper --br=qemubr0",id=hn0
                       -device virtio-net-pci,netdev=hn0,id=nic1
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: default avatarRicha Marwaha <rmarwah@linux.vnet.ibm.com>
      Signed-off-by: default avatarCorey Bryant <coreyb@linux.vnet.ibm.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
  4. 13 Jan, 2012 1 commit
  5. 12 Jan, 2012 1 commit
  6. 06 Jan, 2012 1 commit
  7. 20 Dec, 2011 2 commits
  8. 19 Dec, 2011 1 commit
  9. 15 Dec, 2011 1 commit
  10. 12 Dec, 2011 2 commits
  11. 06 Dec, 2011 2 commits
  12. 22 Nov, 2011 1 commit
  13. 01 Nov, 2011 1 commit
  14. 03 Sep, 2011 1 commit
  15. 22 Aug, 2011 1 commit
  16. 20 Aug, 2011 1 commit
  17. 07 Aug, 2011 2 commits
    • Brad's avatar
      Fix forcing multicast msgs to loopback on OpenBSD. · 23ddf2bb
      Brad authored
      Fix forcing multicast msgs to loopback on OpenBSD.
      $ sudo qemu -m 128 -no-fd-bootchk \
              -hda virtual.img -boot n -nographic \
              -net nic,vlan=0,model=rtl8139,macaddr=52:54:00:12:34:03 \
              -net user -tftp /usr/src/sys/arch/i386/compile/TEST -bootp pxeboot \
              -net nic,vlan=1,model=rtl8139,macaddr=52:54:00:23:03:01 \
              -net tap,vlan=1,script=no \
              -net nic,vlan=3,model=rtl8139,macaddr=52:54:00:23:03:03 \
              -net socket,vlan=3,mcast=
      setsockopt(SOL_IP, IP_MULTICAST_LOOP): Invalid argument
      qemu: -net socket,vlan=3,mcast= Device 'socket' could not be initialized
      Signed-off-by: default avatarBrad Smith <brad@comstyle.com>
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
    • Manuel Bouyer's avatar
      Fix network interface tap backend · 45c245bf
      Manuel Bouyer authored
      Fix network interface tap backend work on NetBSD.
      It uses an ioctl to get the tap name.
      Signed-off-by: Christoph Egger<Christoph.Egger@amd.com>
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
  18. 25 Jul, 2011 1 commit
    • Blue Swirl's avatar
      Wrap recv to avoid warnings · 00aa0040
      Blue Swirl authored
      Avoid warnings like these by wrapping recv():
        CC    slirp/ip_icmp.o
      /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
      /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
      /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'
      Remove also casts used to avoid warnings.
      Reviewed-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
  19. 23 Jul, 2011 2 commits
  20. 24 Jun, 2011 1 commit
  21. 08 Jun, 2011 2 commits
  22. 15 Apr, 2011 2 commits
  23. 21 Mar, 2011 1 commit
    • Paolo Bonzini's avatar
      change all other clock references to use nanosecond resolution accessors · 74475455
      Paolo Bonzini authored
      This was done with:
          sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \
              $(git grep -l 'qemu_get_clock\>' )
          sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \
              $(git grep -l 'qemu_new_timer\>' )
      after checking that get_clock and new_timer never occur twice
      on the same line.  There were no missed occurrences; however, even
      if there had been, they would have been caught by the compiler.
      There was exactly one false positive in qemu_run_timers:
           -    current_time = qemu_get_clock (clock);
           +    current_time = qemu_get_clock_ns (clock);
      which is of course not in this patch.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
  24. 25 Feb, 2011 2 commits
  25. 01 Feb, 2011 2 commits
  26. 21 Dec, 2010 1 commit
  27. 17 Dec, 2010 1 commit
    • Blue Swirl's avatar
      Fix warning on mingw32 · 4d22c6c2
      Blue Swirl authored
      Avoid this warning like other uses of setsockopt:
      /src/qemu/net/socket.c: In function 'net_socket_mcast_create':
      /src/qemu/net/socket.c:210: warning: passing argument 4 of 'setsockopt' from incompatible pointer type
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
  28. 09 Dec, 2010 1 commit
    • Mike Ryan's avatar
      net/sock: option to specify local address · 3a75e74c
      Mike Ryan authored
      Add an option to specify the host IP to send multicast packets from,
      when using a multicast socket for networking. The option takes an IP
      address and sets the IP_MULTICAST_IF socket option, which causes the
      packets to use that IP's interface as an egress.
      This is useful if the host machine has several interfaces with several
      virtual networks across disparate interfaces.
      Signed-off-by: default avatarMike Ryan <mikeryan@ISI.EDU>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
  29. 16 Nov, 2010 1 commit