- 02 4月, 2013 2 次提交
-
-
由 Stefan Hajnoczi 提交于
There are several code paths in net_init_socket() depending on how the socket is created: file descriptor passing, UDP multicast, TCP, or UDP. Some of these support both listen and connect. Not all code paths set the socket to non-blocking. This patch addresses the file descriptor passing and UDP cases which were missing socket_set_nonblock(fd) calls. I considered moving socket_set_nonblock(fd) to a central location but it turns out the code paths are different enough to require non-blocking at different places. Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
-
由 Stefan Hajnoczi 提交于
The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets. Rename to qemu_set_nonblock() just like qemu_set_cloexec(). Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
-
- 25 3月, 2013 2 次提交
-
-
由 Scott Feldman 提交于
Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs. Bump this up to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plenty of room for the ethernet and virtio_net headers. Originally, ran into this limitation when using -netdev UDP sockets to connect VM-to-VM, where VM interface is configure with MTU=9000. (Using virtio_net NIC model). Test is simple: ping -M do -s 8500 <target>. This test will attempt to ping with unfragmented packet of given size. Without patch, size is limited to < 4K (minus protocol hdrs). With patch, ping test works with pkt size up to 9000 (again, minus protocol hdrs). v2: per Stefan, increase buf size to (4096+65536) as done in tap and apply to vde and socket netdevs. v1: increase buf size to 12K just for -netdev UDP sockets Signed-off-by: NScott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Stefan Hajnoczi 提交于
Reduce -netdev socket latency by disabling the Nagle algorithm on SOCK_STREAM sockets in net/socket.c. Since we are tunelling Ethernet over TCP we shouldn't artificially delay outgoing packets, let the guest decide packet scheduling. I already get sub-millisecond -netdev socket ping times on localhost, so there was no measurable difference in my testing. This won't hurt though and may improve remote socket performance. Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NBenoit Canet <benoit@irqsave.net> Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 22 3月, 2013 1 次提交
-
-
由 Stefan Weil 提交于
Instead of adding missing type casts which are needed by MinGW for the 4th argument, the patch uses qemu_setsockopt which was invented for this purpose. Signed-off-by: NStefan Weil <sw@weilnetz.de> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 19 12月, 2012 4 次提交
-
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Move public headers to include/net, and leave private headers in net/. Put the virtio headers in include/net/tap.h, removing the multiple copies that existed. Leave include/net/tap.h as the interface for NICs, and net/tap_int.h as the interface for OS-specific parts of the tap backend. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Touching char/char.h basically causes the whole of QEMU to be rebuilt. Avoid this, it is usually unnecessary. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 01 11月, 2012 1 次提交
-
-
由 Lei Li 提交于
Fix the problem that can not delete the udp socket. It's caused by passing "udp" model to net_socket_udp_init, but we do not have "udp" model in our model list. Pass the right model "socket" to init function. https://bugs.launchpad.net/qemu/+bug/1073585?comments=allSigned-off-by: NLei Li <lilei@linux.vnet.ibm.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 08 10月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
This patch doesn't seem much useful alone, I must admit. However, it makes sense as part of the upcoming directory reorganization, where I want to have include/net/tap.h as the net<->hw interface for tap. Then having both net/tap.h and include/net/tap.h does not work. "Fixed" by moving all the init functions to a single header file net/clients.h. The patch also adopts a uniform style for including net/*.h files from net/*.c, without the net/ path. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
-
- 23 9月, 2012 1 次提交
-
-
由 Stefan Weil 提交于
Commit 213fd508 removed a type cast which is needed for MinGW: net/socket.c:136: warning: pointer targets in passing argument 2 of ‘sendto’ differ in signedness /usr/lib/gcc/amd64-mingw32msvc/4.4.4/../../../../amd64-mingw32msvc/include/winsock2.h:1313: note: expected ‘const char *’ but argument is of type ‘const uint8_t *’ Add a 'qemu_sendto' macro which provides that type cast where needed and use the new macro instead of 'sendto'. Signed-off-by: NStefan Weil <sw@weilnetz.de> Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
-
- 14 9月, 2012 3 次提交
-
-
由 Stefan Hajnoczi 提交于
Replace spinning send_all() with a proper non-blocking send. When the socket write buffer limit is reached, we should stop trying to send and wait for the socket to become writable again. Non-blocking TCP sockets can return in two different ways when the write buffer limit is reached: 1. ret = -1 and errno = EAGAIN/EWOULDBLOCK. No data has been written. 2. ret < total_size. Short write, only part of the message was transmitted. Handle both cases and keep track of how many bytes have been written in s->send_index. (This includes the 'length' header before the actual payload buffer.) Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
由 Stefan Hajnoczi 提交于
Implement asynchronous send for UDP (or other SOCK_DGRAM) sockets. If send fails with EAGAIN we wait for the socket to become writable again. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
由 Stefan Hajnoczi 提交于
The net/socket.c net client is not truly asynchronous. This patch borrows the qemu_set_fd_handler2() code from net/tap.c as the basis for proper asynchronous send/receive. Only read packets from the socket when the peer is able to receive. This avoids needless queuing. Later patches implement asynchronous send. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 07 9月, 2012 1 次提交
-
-
由 Nicholas Bellinger 提交于
This patch renames+moves the net_handle_fd_param() caller used to obtain a file descriptor from either qemu_parse_fd() (the normal case) or from monitor_get_fd() (migration case) into a generically prefixed monitor_handle_fd_param() to be used by vhost-scsi code. Also update net/[socket,tap].c consumers to use the new prefix. Reported-by: NMichael S. Tsirkin <mst@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 01 8月, 2012 5 次提交
-
-
由 Zhi Yong Wu 提交于
The -net socket,listen option does not work with the newer -netdev syntax: http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg01508.html This patch makes it work now. For the case where one vlan has multiple listenning sockets, the patch will also provide the support. Supported syntax: 1.) -net socket,listen=127.0.0.1:1234,vlan=0 2.) -net socket,listen=127.0.0.1:1234,vlan=0 -net socket,listen=127.0.0.1:1235,vlan=0 3.) -netdev socket,listen=127.0.0.1:1234,id=socket0 Drop the NetSocketListenState struct and add a listen_fd field to NetSocketState. When a -netdev socket,listen= instance is created there will be a NetSocketState with fd=-1 and a valid listen_fd. The net_socket_accept() handler waits for listen_fd to become readable and then accepts the connection. When this state transition happens, we no longer monitor listen_fd for incoming connections...until the client disconnects again. Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Zhi Yong Wu 提交于
Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Stefan Hajnoczi 提交于
The vlan feature is no longer part of net core. Rename VLANClientState to NetClientState because net clients are not explicitly associated with a vlan at all, instead they have a peer net client to which they are connected. This patch is a mechanical search-and-replace except for a few whitespace fixups where changing VLANClientState to NetClientState misaligned whitespace. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Stefan Hajnoczi 提交于
Since hubs are now used to implement the 'vlan' feature and the vlan argument is always NULL, remove the argument entirely and update all net clients that use qemu_new_net_client(). Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Stefan Hajnoczi 提交于
Stop using the special-case vlan code in net.c. Instead use the hub net client to implement the vlan feature. The next patch will remove vlan code from net.c completely. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
- 23 7月, 2012 4 次提交
-
-
由 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>
-
由 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>
-
由 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>
-
由 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>
-
- 05 6月, 2012 1 次提交
-
-
由 Luiz Capitulino 提交于
The only backend that really uses it is the socket one, which calls monitor_get_fd(). But it can use 'cur_mon' instead. Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com> Reviewed-By: NLaszlo Ersek <lersek@redhat.com>
-
- 10 2月, 2012 1 次提交
-
-
由 Benjamin MARSILI 提交于
Signed-off-by: NBenjamin MARSILI <mlspirat42@gmail.com> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 13 1月, 2012 1 次提交
-
-
由 Benjamin 提交于
Signed-off-by: NBenjamin MARSILI <mlspirat42@gmail.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 06 1月, 2012 1 次提交
-
-
由 Peter Maydell 提交于
Fix a leak of a file descriptor due to missing closesocket() calls in error paths in net_socket_listen_init(). Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 13 12月, 2011 2 次提交
-
-
由 Stefan Hajnoczi 提交于
Today net/socket.c has no consistent policy for closing the socket file descriptor when initialization fails. This means we leak the file descriptor in some cases or we could also try to close it twice. Make error paths consistent by taking ownership of the file descriptor and closing it on error. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Stefan Hajnoczi 提交于
In order to make later patches sane, expand the tab characters and conform to QEMU coding style now. Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 06 12月, 2011 1 次提交
-
-
由 Zhi Hui Li 提交于
Signed-off-by: NLi Zhi Hui <zhihuili@linux.vnet.ibm.com> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 21 8月, 2011 1 次提交
-
-
由 Anthony Liguori 提交于
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 07 8月, 2011 1 次提交
-
-
由 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>
-
- 25 7月, 2011 1 次提交
-
-
由 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>
-
- 24 6月, 2011 1 次提交
-
-
由 Markus Armbruster 提交于
error_report() prepends location, and appends a newline. The message constructed from the arguments should not contain a newline. Fix the obvious offenders. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 25 2月, 2011 1 次提交
-
-
由 Pavel Dovgaluk 提交于
MSDN includes the following in WSAEALREADY error description for connect() function: "To preserve backward compatibility, this error is reported as WSAEINVAL to Winsock applications that link to either Winsock.dll or Wsock32.dll". So check of this error code was added to allow network connections through the sockets in Windows. Signed-off-by: NPavel Dovgalyuk <pavel.dovgaluk@gmail.com> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 18 12月, 2010 1 次提交
-
-
由 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>
-
- 09 12月, 2010 1 次提交
-
-
由 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>
-
- 16 3月, 2010 1 次提交
-
-
由 Markus Armbruster 提交于
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
-