History | View | Annotate | Download (18.9 kB)
qemu-option: qemu_opts_create(): use error_set()
This commit converts qemu_opts_create() from qerror_report() toerror_set().
Currently, most calls to qemu_opts_create() can't fail, so mostcallers don't need any changes.
The two cases where code checks for qemu_opts_create() erros are:...
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>...
sockets: Drop sockets_debug debug code
I'm trying to improve this code's error reporting, and the debug codeis getting in my way: it clutters the code, it clobbers errno ininconvenient places, and it uses the same fprintf() both for errorreporting and debug output in a few places....
sockets: Clean up inet_listen_opts()'s convoluted bind() loop
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-sockets: Plug fd leak on unix_connect_opts() error path
Spotted by Coverity.
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>
Set errno=ENOTSUP for attempts to use UNIX sockets on Windows platforms
Signed-off-by: Nick Thomas <nick@bytemark.co.uk>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-sockets: avoid strlen of NULL pointer
If the user wants to create a chardev of type socket but forgets to give ahost= option, qemu_opt_get returns NULL. This NULL pointer is then fed intostrlen a few lines below without a check which results in a segfault....
move socket_init to qemu-sockets.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fix inet_parse typo
qemu_opt_set wants on/off, not yes/no.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
net: inet_strfamily(): Better unknown family report
Returning "????" is a bit meaningless, let's call it "unknown".
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>
Add 'static'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
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 unix_*_opts for windows.
Add unix_*_opts function dummys for windows.
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 in file qemu-sockets.c
1) Changed usage of malloc,free,strdup to qemu_malloc,qemu_free,qemu_strdup 2) Some coding style fixes (based on CODING_STYLE document) 3) Free struct addrinfo *res after failure of listen
Signed-off-by: vibi <vibi_sreenivasan@cms.com>...
Fix some more warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6300 c046a42c-6fe2-441c-8c8c-71466251a162
Use qemu_isfoobar and qemu_towombat versions, based on patch by Christoph Egger
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5774 c046a42c-6fe2-441c-8c8c-71466251a162
copyright & license for qemu_sockets.c (Gerd Hoffman)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5714 c046a42c-6fe2-441c-8c8c-71466251a162
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....