1. 01 8月, 2012 1 次提交
  2. 23 7月, 2012 5 次提交
  3. 15 6月, 2012 1 次提交
  4. 05 6月, 2012 1 次提交
  5. 02 2月, 2012 1 次提交
    • 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
  6. 16 12月, 2011 1 次提交
  7. 08 6月, 2011 1 次提交
  8. 02 2月, 2011 1 次提交
  9. 16 11月, 2010 2 次提交
  10. 14 11月, 2010 1 次提交
  11. 04 11月, 2010 1 次提交
  12. 08 9月, 2010 2 次提交
  13. 26 4月, 2010 1 次提交
  14. 02 4月, 2010 3 次提交
  15. 22 3月, 2010 1 次提交
  16. 20 3月, 2010 1 次提交
  17. 16 3月, 2010 2 次提交
  18. 20 2月, 2010 1 次提交
  19. 08 1月, 2010 1 次提交
  20. 03 12月, 2009 3 次提交
  21. 21 11月, 2009 1 次提交
  22. 09 11月, 2009 2 次提交
    • M
      tap: drain queue in tap_send() · 5819c918
      Mark McLoughlin 提交于
      Okay, let's try re-enabling the drain-entire-queue behaviour, with a
      difference - before each subsequent packet, use qemu_can_send_packet()
      to check that we can send it. This is similar to how we check before
      polling the tap fd and avoids having to drop a packet if the receiver
      cannot handle it.
      
      This patch should be a performance improvement since we no longer have
      to go through the mainloop for each packet.
      Signed-off-by: NMark McLoughlin <markmc@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      5819c918
    • M
      tap: disable draining queue in one go · be1636b3
      Mark McLoughlin 提交于
      If qemu_send_packet_async() returns zero, it means the packet has been
      queued and the sent callback will be invoked once it has been flushed.
      
      This is only possible where the NIC's receive() handler returns zero
      and promises to notify the networking core that room is available in its
      queue again.
      
      In the case where the receive handler does not have this capability
      (and its queue fills up) it returns -1 and the networking core does not
      queue up the packet. This condition is indicated by a -1 return from
      qemu_send_packet_async().
      
      Currently, tap handles this condition simply by dropping the packet. It
      should do its best to avoid getting into this situation by checking such
      NIC's have room for a packet before copying the packet from the tap
      interface.
      
      tap_send() used to achieve this by only reading a single packet before
      returning to the mainloop. That way, tap_can_send() is called before
      reading each packet.
      
      tap_send() was changed to completely drain the tap interface queue
      without taking into account the situation where the NIC returns an
      error and the packet is not queued. Let's start fixing this by
      reverting to the previous behaviour of reading one packet at a time.
      Reported-by: NScott Tsai <scottt.tw@gmail.com>
      Tested-by: NSven Rudolph <Sven_Rudolph@drewag.de>
      Signed-off-by: NMark McLoughlin <markmc@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      be1636b3
  23. 31 10月, 2009 1 次提交
    • A
      Unbreak tap compilation on OS X · 71f4effc
      Alexander Graf 提交于
      Currently compiling the tap sources breaks on Mac OS X. This is because of:
      
        1) tap-linux.h requiring Linux includes
        2) typos
        3) missing #includes
      
      This patch adds what's necessary to compile tap happily on Mac OS X.
      I haven't tested if using tap actually works, but I don't think that's a
      major issue as that code was probably seriously untested before already.
      
      I didn't split the patch, because it's only a few lines of code and
      splitting is probably not worth the effort here.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      71f4effc
  24. 30 10月, 2009 5 次提交