History log of /qemu/net/socket.c (Results 76 – 100 of 104)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v1.2.0-rc0
# 011de2b5 20-Jul-2012 Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

net: add the support for -netdev socket, listen

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 p

net: add the support for -netdev socket, listen

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: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

show more ...


# e34cde35 20-Jul-2012 Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

net: fix the coding style

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>


# 4e68f7a0 24-Jul-2012 Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

net: Rename VLANClientState to NetClientState

The vlan feature is no longer part of net core. Rename VLANClientState
to NetClientState because net clients are not explicitly associated with
a vlan

net: Rename VLANClientState to NetClientState

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: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

show more ...


# ab5f3f84 24-Jul-2012 Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

net: Drop vlan argument to qemu_new_net_client()

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

net: Drop vlan argument to qemu_new_net_client()

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: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

show more ...


# d33d93b2 24-Jul-2012 Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

net: Use hubs for the vlan feature

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 com

net: Use hubs for the vlan feature

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: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

show more ...


# 1a0c0958 17-Jul-2012 Laszlo Ersek <lersek@redhat.com>

remove unused QemuOpts parameter from net init functions

v1->v2:
- unchanged

v2->v3:
- keep "qemu-option.h" included in "net/slirp.h"

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by:

remove unused QemuOpts parameter from net init functions

v1->v2:
- unchanged

v2->v3:
- keep "qemu-option.h" included in "net/slirp.h"

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

show more ...


# bef8e8fe 17-Jul-2012 Laszlo Ersek <lersek@redhat.com>

convert net_init_socket() to NetClientOptions

I "reverse engineered" the following permissions between the -socket
sub-options:

fd listen connect mcast udp | localaddr
fd

convert net_init_socket() to NetClientOptions

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: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

show more ...


# 6687b79d 17-Jul-2012 Laszlo Ersek <lersek@redhat.com>

convert net_client_init() to OptsVisitor

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 me

convert net_client_init() to OptsVisitor

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: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

show more ...


# 2be64a68 17-Jul-2012 Laszlo Ersek <lersek@redhat.com>

hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)

NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <st

hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)

NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

show more ...


Revision tags: v1.1.1, v1.1.0, v1.1.0-rc4, v1.1.0-rc3, v1.1-rc2, v1.1.0-rc2, v1.1-rc1, v1.1-rc0
# 42dcc547 12-Apr-2012 Luiz Capitulino <lcapitulino@redhat.com>

net: purge the monitor object from all init functions

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: Luiz Cap

net: purge the monitor object from all init functions

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: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-By: Laszlo Ersek <lersek@redhat.com>

show more ...


Revision tags: v1.0.1
# da8d6057 22-Jan-2012 Benjamin MARSILI <mlspirat42@gmail.com>

net: remove extra spaces in help messages

Signed-off-by: Benjamin MARSILI <mlspirat42@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>


# 0e0e7fac 11-Jan-2012 Benjamin <mlspirat42@gmail.com>

Support for UDP unicast network backend

Signed-off-by: Benjamin MARSILI <mlspirat42@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


# a46667ea 24-Dec-2011 Peter Maydell <peter.maydell@linaro.org>

net/socket.c: Fix fd leak in net_socket_listen_init() error paths

Fix a leak of a file descriptor due to missing closesocket() calls
in error paths in net_socket_listen_init().

Signed-off-by: Peter

net/socket.c: Fix fd leak in net_socket_listen_init() error paths

Fix a leak of a file descriptor due to missing closesocket() calls
in error paths in net_socket_listen_init().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

show more ...


# e5d1fca0 07-Dec-2011 Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

net: take ownership of fd in socket init functions

Today net/socket.c has no consistent policy for closing the socket file
descriptor when initialization fails. This means we leak the file
descript

net: take ownership of fd in socket init functions

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: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

show more ...


# 842480d4 07-Dec-2011 Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

net: expand tabs in net/socket.c

In order to make later patches sane, expand the tab characters and
conform to QEMU coding style now.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Si

net: expand tabs in net/socket.c

In order to make later patches sane, expand the tab characters and
conform to QEMU coding style now.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

show more ...


Revision tags: v1.0, v1.0-rc4
# c7ee8f68 24-Nov-2011 Zhi Hui Li <zhihuili@linux.vnet.ibm.com>

net/socket.c : fix memory leak

Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>


Revision tags: v1.0-rc3, v1.0-rc2, v1.0-rc1, v1.0-rc0, v0.15.1
# 7267c094 21-Aug-2011 Anthony Liguori <aliguori@us.ibm.com>

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


Revision tags: v0.15.0
# 23ddf2bb 07-Aug-2011 Brad <brad@comstyle.com>

Fix forcing multicast msgs to loopback on OpenBSD.

Fix forcing multicast msgs to loopback on OpenBSD.
e.g.
$ sudo qemu -m 128 -no-fd-bootchk \
-hda virtual.img -boot n -nographic \
-

Fix forcing multicast msgs to loopback on OpenBSD.

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: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

show more ...


Revision tags: v0.15.0-rc2, v0.15.0-rc1
# 00aa0040 23-Jul-2011 Blue Swirl <blauwirbel@gmail.com>

Wrap recv to avoid warnings

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: passi

Wrap recv to avoid warnings

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: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

show more ...


Revision tags: v0.15.0-rc0
# 6daf194d 22-Jun-2011 Markus Armbruster <armbru@redhat.com>

Strip trailing '\n' from error_report()'s first argument

error_report() prepends location, and appends a newline. The message
constructed from the arguments should not contain a newline. Fix the
o

Strip trailing '\n' from error_report()'s first argument

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: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

show more ...


Revision tags: v0.14.1
# c7eb1f02 21-Feb-2011 Pavel Dovgaluk <Pavel.Dovgaluk@ispras.ru>

Fixing network over sockets implementation for win32

MSDN includes the following in WSAEALREADY error description for connect()
function: "To preserve backward compatibility, this error is reporte

Fixing network over sockets implementation for win32

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: Pavel Dovgalyuk <pavel.dovgaluk@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

show more ...


Revision tags: v0.14.0, v0.14.0-rc2, v0.14.0-rc1, v0.14.0-rc0
# 4d22c6c2 17-Dec-2010 Blue Swirl <blauwirbel@gmail.com>

Fix warning on mingw32

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 'se

Fix warning on mingw32

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: Blue Swirl <blauwirbel@gmail.com>

show more ...


# 3a75e74c 01-Dec-2010 Mike Ryan <mikeryan@isi.edu>

net/sock: option to specify local address

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 t

net/sock: option to specify local address

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: Mike Ryan <mikeryan@ISI.EDU>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

show more ...


Revision tags: v0.13.0, v0.13.0-rc3, v0.13.0-rc2, v0.13.0-rc1, v0.13.0-rc0, v0.12.5, v0.12.4, v0.12.3
# 1ecda02b 18-Feb-2010 Markus Armbruster <armbru@redhat.com>

error: Replace qemu_error() by error_report()

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

error: Replace qemu_error() by error_report()

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.

show more ...


# 2f792016 18-Feb-2010 Markus Armbruster <armbru@redhat.com>

error: Move qemu_error & friends into their own header


12345