1. 23 7月, 2012 4 次提交
    • L
      remove unused QemuOpts parameter from net init functions · 1a0c0958
      Laszlo Ersek 提交于
      v1->v2:
      - unchanged
      
      v2->v3:
      - keep "qemu-option.h" included in "net/slirp.h"
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      1a0c0958
    • L
      convert net_init_socket() to NetClientOptions · bef8e8fe
      Laszlo Ersek 提交于
      I "reverse engineered" the following permissions between the -socket
      sub-options:
      
                   fd  listen  connect  mcast  udp | localaddr
        fd         x   .       .        .      .   | .
        listen     .   x       .        .      .   | .
        connect    .   .       x        .      .   | .
        mcast      .   .       .        x      .   | x
        udp        .   .       .        .      x   | x
        -------------------------------------------+
        localaddr  .   .       .        x      x     x
      
      I transformed the code accordingly. The real fix would be to embed "fd",
      "listen", "connect", "mcast" and "udp" in a separate union. However
      OptsVisitor's enum parser only supports the type=XXX QemuOpt instance as
      union discriminator.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      bef8e8fe
    • L
      convert net_client_init() to OptsVisitor · 6687b79d
      Laszlo Ersek 提交于
      The net_client_init() prototype is kept intact.
      
      Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a
      Netdev or a NetLegacy. The original meat of net_client_init() is moved to
      and simplified in net_client_init1():
      
      Fields not common between -net and -netdev are clearly separated. Getting
      the name for the init functions is cleaner: Netdev::id is mandatory, and
      all init functions handle a NULL NetLegacy::name. NetLegacy::vlan
      explicitly depends on -net (see below).
      
      Verifying the "type=" option for -netdev can be turned into a switch.
      
      Format validation with qemu_opts_validate() can be removed because the
      visitor covers it. Relatedly, the "net_client_types" array is reduced to
      an array of init functions that can be directly indexed by opts->kind.
      (Help text is available in the schema JSON.)
      
      The outermost negation in the condition around qemu_find_vlan() was
      flattened, because it expresses the dependent code's requirements more
      clearly.
      
      VLAN lookup is avoided if there's no init function to pass the VLAN to.
      
      Whenever the value of type=... is needed, we substitute
      NetClientOptionsKind_lookup[kind].
      
      The individual init functions are not converted yet, thus the original
      QemuOpts instance is passed transparently.
      
      v1->v2:
      - NetLegacy::name is optional. Tracked it through all init functions: they
        all handle a NULL name. Updated commit message accordingly.
      
      v2->v3:
      - NetLegacy::id is allowed and takes precedence over NetLegacy::name.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      6687b79d
    • L
      hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated) · 2be64a68
      Laszlo Ersek 提交于
      NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      2be64a68
  2. 05 6月, 2012 1 次提交
  3. 10 2月, 2012 1 次提交
  4. 13 1月, 2012 1 次提交
  5. 06 1月, 2012 1 次提交
  6. 13 12月, 2011 2 次提交
  7. 06 12月, 2011 1 次提交
  8. 21 8月, 2011 1 次提交
  9. 07 8月, 2011 1 次提交
    • B
      Fix forcing multicast msgs to loopback on OpenBSD. · 23ddf2bb
      Brad 提交于
      Fix forcing multicast msgs to loopback on OpenBSD.
      e.g.
      $ 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=230.0.0.1:10003
      setsockopt(SOL_IP, IP_MULTICAST_LOOP): Invalid argument
      qemu: -net socket,vlan=3,mcast=230.0.0.1:10003: Device 'socket' could not be initialized
      Signed-off-by: NBrad Smith <brad@comstyle.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      23ddf2bb
  10. 25 7月, 2011 1 次提交
    • B
      Wrap recv to avoid warnings · 00aa0040
      Blue Swirl 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      00aa0040
  11. 24 6月, 2011 1 次提交
  12. 25 2月, 2011 1 次提交
  13. 18 12月, 2010 1 次提交
    • B
      Fix warning on mingw32 · 4d22c6c2
      Blue Swirl 提交于
      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: NBlue Swirl <blauwirbel@gmail.com>
      4d22c6c2
  14. 09 12月, 2010 1 次提交
    • M
      net/sock: option to specify local address · 3a75e74c
      Mike Ryan 提交于
      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: NMike Ryan <mikeryan@ISI.EDU>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3a75e74c
  15. 16 3月, 2010 2 次提交
  16. 20 2月, 2010 1 次提交
  17. 04 12月, 2009 1 次提交
  18. 03 12月, 2009 2 次提交