1. 07 9月, 2012 1 次提交
  2. 10 8月, 2012 1 次提交
  3. 01 8月, 2012 15 次提交
  4. 23 7月, 2012 9 次提交
  5. 09 7月, 2012 4 次提交
  6. 15 6月, 2012 1 次提交
  7. 09 6月, 2012 1 次提交
    • M
      do not include <libutil.h> needlessly or if it doesn't exist · 3294ce18
      Michael Tokarev 提交于
      <libutil.h> and <util.h> on *BSD (some have one, some another)
      were #included just for openpty() declaration.  The only file
      where this function is actually used is qemu-char.c.
      
      In vl.c and net/tap-bsd.c, none of functions declared in libutil.h
      (login logout logwtmp timdomain openpty forkpty uu_lock realhostname
      fparseln and a few others depending on version) are used.
      
      Initially the code which is currently in qemu-char.c was in vl.c,
      it has been removed into separate file in commit 0e82f34d
      Fri Oct 31 18:44:40 2008, but the #includes were left in vl.c.
      So with vl.c, we just remove includes - libutil.h, util.h and
      pty.h (which declares only openpty() and forkpty()) from there.
      
      The code in net/tap-bsd.c, which come from net/tap.c, had this
      
      commit 5281d757
      Author: Mark McLoughlin <markmc@redhat.com>
      Date:   Thu Oct 22 17:49:07 2009 +0100
      
          net: split all the tap code out into net/tap.c
      
      Note this commit not only moved stuff out of net.c to net/tap.c,
      but also rewrote large portions of the tap code, and added these
      completely unnecessary #includes -- as usual, I question why such
      a misleading commit messages are allowed.
      
      Again, no functions defined in libutil.h or util.h on *BSD are
      used by neither net/tap.c nor net/tap-bsd.c.  Removing them.
      
      And finally, the only real user for these #includes, qemu-char.c,
      which actually uses openpty().  There, the #ifdef logic is wrong.
      A GLIBC-based system has <pty.h>, even if it is a variant of *BSD.
      So __GLIBC__ should be checked first, and instead of trying to
      include <libutil.h> or <util.h>, we include <pty.h>.  If it is not
      GLIBC-based, we check for variations between <*util.h> as before.
      
      This patch fixes build of qemu 1.1 on Debian/kFreebsd (well, one
      of the two problems): it is a distribution with a FreeBSD kernel,
      so it #defines at least __FreeBSD_kernel__, but since it is based
      on GLIBC, it has <pty.h>, but current version does not have neither
      <util.h> nor <libutil.h>, which the code tries to include 3 times
      but uses only once.
      Signed-off-By: NMichael Tokarev <mjt@tls.msk.ru>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      3294ce18
  8. 07 6月, 2012 1 次提交
  9. 05 6月, 2012 1 次提交
  10. 02 5月, 2012 2 次提交
    • N
      Declare state directory in smb.conf · 276eda57
      Nikolaus Rath 提交于
      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
      http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757).
      
      This patch adds the missing option.
      Signed-off-by: NNikolaus Rath <Nikolaus@rath.org>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      276eda57
    • N
      slirp: don't use "smb ports = 0" option · de305b13
      Nikolaus Rath 提交于
      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: NNikolaus Rath <Nikolaus@rath.org>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      de305b13
  11. 10 2月, 2012 1 次提交
  12. 02 2月, 2012 2 次提交
    • S
      Change license from GPLv2 to GPLv2+ · 4c32fe66
      Stefan Weil 提交于
      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: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      4c32fe66
    • C
      Add support for net bridge · a7c36ee4
      Corey Bryant 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NRicha Marwaha <rmarwah@linux.vnet.ibm.com>
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a7c36ee4
  13. 14 1月, 2012 1 次提交