History | View | Annotate | Download (2.5 kB)
qemu-sockets: add socket_listen, socket_connect, socket_parse
These are QAPI-friendly versions of the qemu-sockets functions. Theysupport IP sockets, Unix sockets, and named file descriptors, using aQAPI union to dispatch to the correct function.
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>...
qemu-sockets: add Error ** to all functions
This lets me adjust the clients to do proper error propagation first,thus avoiding temporary regressions in the quality of the error messages.
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-sockets: add nonblocking connect for Unix sockets
This patch mostly mimics what was done to TCP sockets, but simplerbecause there is only one address to try. It also includes a free EINTRbug fix.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Fix address handling in inet_nonblocking_connect
getaddrinfo can give us a list of addresses, but we only try toconnect to the first one. If that fails we never proceed tothe next one. This is common on desktop setups that often have ipv6configured but not actually working....
Separate inet_connect into inet_connect (blocking) and inet_nonblocking_connect
No need to add non blocking parameters to the blocking inet_connectadd block parameter for inet_connect_opts instead of using QemuOpt "block".
Signed-off-by: Orit Wasserman <owasserm@redhat.com>...
net: inet_connect(), inet_connect_opts(): add in_progress argument
It's used to indicate the special case where a valid file-descriptoris returned (ie. success) but the connection can't be completedw/o blocking.
This is needed because QERR_SOCKET_CONNECT_IN_PROGRESS is not...
sockets: change inet_connect() to support nonblock socket
Add a bool argument to inet_connect() to assign if set socketto block/nonblock, and delete original argument 'socktype'that is unused.Add a new argument to inet_connect()/inet_connect_opts(),to pass back connect error by error class....
sockets: use error class to pass listen error
Add a new argument in inet_listen()/inet_listen_opts()to pass back listen error.
Change nbd, qemu-char, vnc to use new interface.
Signed-off-by: Amos Kong <akong@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
w32: Move defines for socket specific errors to qemu-os-win32.h
As those defines are only used for w32,they should be in the header file for w32.
All files which include slirp.h or qemu_socket.h alsoinclude qemu-os-win32.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
w32: Undefine error constants before their redefinition
Avoids lots of warnings.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
move corking functions to osdep.c
add socket_set_block
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
net: remove parse_host_src_port() function
It was deprecated, and it has no users.
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix OpenBSD build
Add #include <sys/types.h>, needed by #include <sys/socket.h>.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
move socket_init to qemu-sockets.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
net: Make inet_strfamily() public
So that it can be used by other subsystems.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
convert udp chardev to QemuOpts.
While being at it: create a new inet_dgram_opts() function for udp setup,so udp can handle IPv6 now.
new cmd line syntax: -chardev udp,id=name,host=remotehost,port=remoteport,\ localaddr=bindaddr,localport=bindport...
sockets: add unix_connect_opts
Add unix_connect_opts(). Does the same as unix_connect(), but usesQemuOpts. unix_connect() is a compatibility wrapper forunix_connect_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
sockets: add unix_listen_opts
Add unix_listen_opts(). Does the same as unix_listen(), but usesQemuOpts. unix_listen() is a compatibility wrapper forunix_listen_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sockets: add inet_connect_opts
Add inet_connect_opts(). Does the same as inet_connect(), but usesQemuOpts. inet_connect() is a compatibility wrapper forinet_connect_opts() now and should go away some day.
sockets: add inet_listen_opts
Add inet_listen_opts(). Does the same as inet_listen(), but usesQemuOpts. inet_listen() is a compatibility wrapper forinet_listen_opts() now and should go away some day.
Fix windows build and clean up use of <windows.h>
We want to globally define WIN_LEAN_AND_MEAN and WINVER to particular values solet's do it in OS_CFLAGS.
Then, we can pepper in windows.h includes where using #includes that require it.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
sockets: helper functions for qemu (Gerd Hoffman)
This patch creates a new source file qemu-sockets.c with a bunch ofhelper functions to create listening and connected sockets.
New features of this code are (a) support for searching for a freeport in a given range and (b) support for IPv6....
Move some declarations around in the QEMU CharDriver code
The goal of this series is to move the CharDriverState code out of vl.c andinto its own file, qemu-char.c. This patch moves around some declarations sothe next patch can be pure code motion.
Introduce UI for live migration
This patch introduces a command line parameter and monitor command for startinga live migration. The next patch will provide an example of how to use theseparameters.
Use common objects for qemu-img and qemu-nbd
Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over thecode. It's ugly and causes us to have to build multiple object files forlinking against qemu and the tools.
This patch introduces a new file, qemu-tool.c which contains enough for...
Use WIN32_LEAN_AND_MEAN, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3832 c046a42c-6fe2-441c-8c8c-71466251a162
Run monitor over unix domain sockets, by Anthony Liguori.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2259 c046a42c-6fe2-441c-8c8c-71466251a162
win32 socket fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1876 c046a42c-6fe2-441c-8c8c-71466251a162