[Qemu-devel] [PULL 19/64] slirp: remove HAVE_SYS_SIGNAL_H

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/slirp.h| 3 --- slirp/slirp_config.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index f7c087456a..4c3c672ee6

[Qemu-devel] [PULL 13/64] slirp: move socket pair creation in helper function

2018-12-18 Thread Samuel Thibault
r_with_oob() since the code is actually similar to what socketpair() would do, except that it uses TCP sockets, for SLIRP to be able to call send with MSG_OOB (since SO_OOBINLINE is set, this could probably be faked instead on regular unix sockets though). Signed-off-by: Marc-André Lureau Signed-off-

[Qemu-devel] [PULL 07/64] slirp: move internal function declarations

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Clarify that those functions are internal to slirp. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/libslirp.h | 3 --- slirp/slirp.h| 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/slirp/libslirp.h b/slirp

[Qemu-devel] [PULL 06/64] slirp: rename /extra/chardev

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Now it's only used for the chardev pointer. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/slirp.c| 4 ++-- slirp/socket.h | 2 +- slirp/tcp_subr.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/slirp/slirp.c b

[Qemu-devel] [PULL 24/64] slirp: remove unused HAVE_SYS_WAIT_H

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/slirp.h| 4 slirp/slirp_config.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index 400f585cec..1f47848271

[Qemu-devel] [PULL 12/64] slirp: add tftp tracing

2018-12-18 Thread Samuel Thibault
From: Gerd Hoffmann Useful when debugging pxeboot, to see what the guest tries to do. Signed-off-by: Gerd Hoffmann Reviewed-by: Liam Merwick Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Thibault --- Makefile.objs | 1 + slirp/tftp.c

[Qemu-devel] [PULL 09/64] slirp: fix slirp_add_exec() leaks

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Free the list elements allocated in add_exec(). Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.h | 2 +- slirp/slirp.c | 8 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/slirp/misc.h b/slirp/misc.h index

[Qemu-devel] [PULL 01/64] slirp: associate slirp_output callback with the Slirp context

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Let's make the slirp interface a bit more library-like. Associate the slirp_output() with a Slirp context. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 5 +++-- slirp/libslirp.h | 9 + slirp/ncsi.c | 2 +- slirp

[Qemu-devel] [PULL 04/64] slirp: use a dedicated field for chardev pointer

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau Let's not mix command line and chardev pointers. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 8 slirp/libslirp.h | 2 +- slirp/misc.c | 11 +++ slirp/misc.h | 4 ++-- slirp/slirp.c| 5

[Qemu-devel] [PULL 03/64] slirp: replace ex_pty with ex_chardev

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau do_pty == 3 means to talk to a chardev. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.c | 2 +- slirp/misc.h | 2 +- slirp/slirp.c| 4 ++-- slirp/tcp_subr.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff

[Qemu-devel] [PULL 05/64] slirp: remove unused EMU_RSH

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau EMU_RSH handling was dropped in commit 0d62c4cfe21752df4c1d6e2c2398f15d5eaa794a. The assignment, and subsequent free() of ex_ptr->ex_exec to so->extra looks unsafe (double free is likely to occur). Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Th

[Qemu-devel] [PULL 02/64] slirp: remove do_pty from fork_exec()

2018-12-18 Thread Samuel Thibault
From: Marc-André Lureau QEMU uses fork_exec() with do_pty values 0 or 3. Let's clean up some unused code. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.c | 55 ++-- slirp/misc.h | 2 +- slirp/tcp_subr.c

Re: [Qemu-devel] [PATCH] slirp: Mark debugging calls as unlikely

2018-11-22 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 11:13:51 +0400, a ecrit: > With s/unlikely/G_UNLIKELY: > Reviewed-by: Marc-André Lureau Right, pushed, thanks :)

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 14/30] slirp: set G_LOG_DOMAIN

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:31 +0400, a ecrit: > We are moving to g_log() facilities to log errors and probably debug > messages too. Let's have the "Slirp" prefix on messages slirp produces. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 25/30] slirp: replace trace functions with DEBUG calls

2018-11-21 Thread Samuel Thibault
Hello, Marc-André Lureau, le jeu. 22 nov. 2018 02:06:42 +0400, a ecrit: > Remove a dependency on QEMU. Use the existing logging facilities. > Set SLIRP_DEBUG=tftp to get tftp log. As mentioned before, I was hesitating to replace the tracing with a DEBUG call. Now that I have merged to my tree

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 11/30] slirp: add clock_get_ns() callback

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:28 +0400, a ecrit: > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 13/30] build-sys: use a seperate slirp-obj-y && slirp.mo

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:30 +0400, a ecrit: > This will allow to have cflags for the whole slirp.mo -objs. > It makes it possible to build tests that links only with > slirp-obj-y (and not the whole common-obj). > > It is also a step towards building slirp as a shared

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 24/30] slirp: call into g_debug() for DEBUG macros

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:41 +0400, a ecrit: > Make slirp use GLib logging, instead of fprintf(), so that > applications can filter log, process it etc. > > With recent versions of glib, G_MESSAGES_DEBUG must be set to "all" or > "Slirp" to see slirp debug messages. > >

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 19/30] slirp: always build with debug statements

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:36 +0400, a ecrit: > Make debug statements condiitonal only on slirp_debug flags, instead > of the pre-processor DEBUG blocks, as it may introduce breakage > easily, since the debug code isn't always compiled. > > Signed-off-by: Marc-André Lureau

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 06/30] slirp: factor out guestfwd addition checks

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:23 +0400, a ecrit: > This will allow reusing the function in a following patch. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 20/30] slirp: introduce SLIRP_DEBUG environment variable

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:37 +0400, a ecrit: > Learn to read SLIRP_DEBUG=call,misc,error (all or help also handled) > to set the slirp_debug flags. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 23/30] slirp: replace DEBUG_ARGS with DEBUG_ARG

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:40 +0400, a ecrit: > There is no clear benefit in calling an alias DEBUG_ARGS(). Replace > calls with DEBUG_ARG(), and fix the white-spacing while at it. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 22/30] slirp: remove remaining DEBUG blocks

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:39 +0400, a ecrit: > Instead, rely on slirp_debug flags, or compile unconditionally (the > substraction in cksum is unlikely to affect any benchmark result). > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 16/30] slirp: replace some fprintf() with DEBUG_MISC

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:33 +0400, a ecrit: > Remove some clutter, and avoids direct call to fprintf(). > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

[Qemu-devel] [PATCH] slirp: Mark debugging calls as unlikely

2018-11-21 Thread Samuel Thibault
to get them out of the hot path. Signed-off-by: Samuel Thibault --- slirp/debug.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slirp/debug.h b/slirp/debug.h index ff920f0b87..ad4e07aa01 100644 --- a/slirp/debug.h +++ b/slirp/debug.h @@ -17,7 +17,7 @@ extern int

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 21/30] slirp: use %p for pointers format

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:38 +0400, a ecrit: > This fixes some compilation warnings on mingw64. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 15/30] slirp: replace error_report() and a fprintf with g_critical()

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:32 +0400, a ecrit: > Reduce dependency on QEMU. QEMU could use a custom glib log handler if > it wants to redirect/filter it. > > Signed-off-by: Marc-André Lureau Applied, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 17/30] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:34 +0400, a ecrit: > icmp_send_error() doesnt actually log messages when DEBUG is enabled. > Let's use a different define that describes better the tweaked > behaviour of the function, and avoid uncompiled code. > > Signed-off-by: Marc-André Lureau

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 10/30] slirp: use virtual time for packet expiration

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:27 +0400, a ecrit: > Make all packets expiration time based on virtual clock. > > Suggested-by: Paolo Bonzini > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 18/30] slirp: no need to make DPRINTF conditional on DEBUG

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:35 +0400, a ecrit: > DEBUG_CALL is already handled conditionally. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 05/30] slirp: rename exec_list

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:22 +0400, a ecrit: > This list is not only used to handle command to execute on guest > connection, it can also redirect to an arbitrary object, such as a > chardev. Let's rename the struct and the field to "guestfwd". > > Signed-off-by: Marc-André

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 01/30] fixup! net: do not depend on slirp internals

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:18 +0400, a ecrit: > Somehow, I broke the build and failed to detect it. Please squash! > +#include "qemu/osdep.h" > + > +typedef uint32_t tcp_seq; I preferred to just use uint32_t instead of tcp_seq in the couple of places where this showed up. >

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 04/30] slirp: simplify fork_exec()

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:21 +0400, a ecrit: > Use g_spawn_async_with_fds() to setup the child. > > GSpawn handles reaping the child, and closing parent file descriptors. > > Signed-off-by: Marc-André Lureau Ditto. Samuel

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 03/30] glib-compat: add g_spawn_async_with_fds() fallback

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:20 +0400, a ecrit: > Signed-off-by: Marc-André Lureau > Reviewed-by: Samuel Thibault I had actually already included it in my tree. Samuel

Re: [Qemu-devel] [PATCH v2 for-3.2 v2 02/30] slirp: drop

2018-11-21 Thread Samuel Thibault
Marc-André Lureau, le jeu. 22 nov. 2018 02:06:19 +0400, a ecrit: > Since commit 12f8def0e02232d7c6416ad9b66640f973c531d1 (v2.9), qemu > requires Vista. Let's remove some conditional code. > > Note that this introduces a missing declaration warning with mingw. > warning: implicit declaration of

Re: [Qemu-devel] [PATCH for-3.2 38/41] net: do not depend on slirp internals

2018-11-19 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 14 nov. 2018 14:21:36 +0100, a ecrit: > > Signed-off-by: Marc-André Lureau > > Reviewed-by: Philippe Mathieu-Daudé > Tested-by: Philippe Mathieu-Daudé Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 37/41] slirp: replace ARRAY_SIZE with G_N_ELEMENTS

2018-11-19 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 14 nov. 2018 14:17:56 +0100, a ecrit: > On 14/11/18 13:36, Marc-André Lureau wrote: > > Do not require QEMU macro. > > > > Signed-off-by: Marc-André Lureau > > Reviewed-by: Philippe Mathieu-Daudé Daniel P. Berrangé, le mer. 14 nov. 2018 14:15:15 +, a ecrit:

Re: [Qemu-devel] [PATCH for-3.2 36/41] slirp: remove dead TCP_ACK_HACK code

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 14:12:06 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:38PM +0400, Marc-André Lureau wrote: > > Untouched since original introduction in 2004. > > > > Signed-off-by: Marc-André Lureau > > --- > > slirp/tcp_input.c | 23 +-- > > 1

Re: [Qemu-devel] [PATCH for-3.2 35/41] slirp: NULL is defined by glib (at least)

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 14:11:34 +, a ecrit: > NULL is defined in stddef.h for at least 15 years AFAICT, so > even glib shouldn't bother to define it :-) So I'd suggest > changing $subject to just defer to stddef.h > > On Wed, Nov 14, 2018 at 04:36:37PM +0400, Marc-André

Re: [Qemu-devel] [PATCH for-3.2 33/41] slirp: replace qemu_notify_event() with a callback

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:35 +0400, a ecrit: > Use a "slirp socket" helper function to call the callback when > sbdrop() returns true. It's really far from clear what this should be doing :) I'd say find out how to rephrase 86073017e384 ("slirp: Signal free input buffer space

Re: [Qemu-devel] [PATCH for-3.2 32/41] slirp: remove unused sbflush()

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 14:05:33 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:34PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/sbuf.h | 1 - > > 1 file changed, 1 deletion(-) > > Reviewed-by: Daniel P. Berrangé Applied to my tree,

Re: [Qemu-devel] [PATCH for-3.2 34/41] slirp: remove #if notdef dead code

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 14:07:38 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:36PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/ip_input.c | 200 -- > > slirp/tcp_input.c | 39 - >

Re: [Qemu-devel] [PATCH for-3.2 31/41] slirp: add a callback to log guest errors

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:33 +0400, a ecrit: > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 30/41] slirp: replace trace functions with DEBUG calls

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:32 +0400, a ecrit: > Remove a dependency on QEMU. Use the existing logging facilities. I'm hesitating on this one: this is not really a debugging print (as in qemu debugging), but a real user debugging print. We do want to compile this in without

Re: [Qemu-devel] [PATCH for-3.2 29/41] slirp: improve a bit the debug macros

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:31 +0400, a ecrit: > Let them accept multiple arguments. Simplify the inner argument > handling of DEBUG_ARGS/DEBUG_MISC_DEBUG_ERROR. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 28/41] slirp: replace error_report() with g_critical()

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:30 +0400, a ecrit: > Reduce dependency on QEMU. QEMU could use a custom log handler if it > wants to redirect/filter it. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 26/41] slirp: replace compile time DO_KEEPALIVE

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:28 +0400, a ecrit: > Use a global variable instead (similar to slirp_debug) > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 25/41] slirp: replace SIZEOF_CHAR_P with glib equivalent

2018-11-19 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 14 nov. 2018 14:14:35 +0100, a ecrit: > On 14/11/18 13:36, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > Reviewed-by: Philippe Mathieu-Daudé Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 27/41] slirp: remove unused global slirp_instance

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:55:18 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:29PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h | 2 -- > > 1 file changed, 2 deletions(-) > > Reviewed-by: Daniel P. Berrangé Applied to my

Re: [Qemu-devel] [PATCH for-3.2 21/41] slirp: remove HAVE_SYS_FILIO_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:52:12 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:23PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 2 +- > > slirp/slirp_config.h | 6 -- > > 2 files changed, 1 insertion(+), 7

Re: [Qemu-devel] [PATCH for-3.2 24/41] slirp: replace HOST_WORDS_BIGENDIAN with glib equivalent

2018-11-19 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 14 nov. 2018 14:14:16 +0100, a ecrit: > On 14/11/18 13:36, Marc-André Lureau wrote: > > One more step towards making the project independent from QEMU. > > > > Signed-off-by: Marc-André Lureau > > Reviewed-by: Philippe Mathieu-Daudé Daniel P. Berrangé, le mer.

Re: [Qemu-devel] [PATCH for-3.2 20/41] slirp: remove HAVE_SYS_IOCTL_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:51:29 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:22PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 2 +- > > slirp/slirp_config.h | 6 -- > > 2 files changed, 1 insertion(+), 7

Re: [Qemu-devel] [PATCH for-3.2 23/41] slirp: remove unused HAVE_INET_ATON

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:54:33 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:25PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp_config.h | 6 -- > > 1 file changed, 6 deletions(-) > > Reviewed-by: Daniel P. Berrangé

Re: [Qemu-devel] [PATCH for-3.2 22/41] slirp: remove unused DECLARE_IOVEC

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:53:31 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:24PM +0400, Marc-André Lureau wrote: > > It's actually qemu configure CONFIG_IOVEC that is being used. > > That makes it sound like slirp is using CONFIG_IOVEC, but AFAICT > that's only used by

Re: [Qemu-devel] [PATCH for-3.2 19/41] slirp: remove unused HAVE_SYS_SELECT_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:51:01 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:21PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/main.h | 4 > > slirp/slirp.h| 4 > > slirp/slirp_config.h | 6 -- > > 3

Re: [Qemu-devel] [PATCH for-3.2 16/41] slirp: remove unused HAVE_SYS_STROPTS_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:49:08 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:18PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 5 - > > slirp/slirp_config.h | 3 --- > > 2 files changed, 8 deletions(-) > >

Re: [Qemu-devel] [PATCH for-3.2 18/41] slirp: remove unused HAVE_SYS_WAIT_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:50:33 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:20PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 4 > > slirp/slirp_config.h | 3 --- > > 2 files changed, 7 deletions(-) > >

Re: [Qemu-devel] [PATCH for-3.2 17/41] slirp: remove unused HAVE_ARPA_INET_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:50:01 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:19PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp_config.h | 6 -- > > 1 file changed, 6 deletions(-) > > Reviewed-by: Daniel P. Berrangé

Re: [Qemu-devel] [PATCH for-3.2 15/41] slirp: remove NO_UNIX_SOCKETS

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:48:37 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:17PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 3 --- > > slirp/slirp_config.h | 6 -- > > 2 files changed, 9 deletions(-) > >

Re: [Qemu-devel] [PATCH for-3.2 14/41] slirp: remove unused HAVE_SYS_BITYPES_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:47:57 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:16PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 4 > > slirp/slirp_config.h | 3 --- > > 2 files changed, 7 deletions(-) > >

Re: [Qemu-devel] [PATCH for-3.2 13/41] slirp: remove HAVE_SYS_SIGNAL_H

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:47:32 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:15PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/slirp.h| 3 --- > > slirp/slirp_config.h | 3 --- > > 2 files changed, 6 deletions(-) > >

[Qemu-devel] [PATCH] slirp: Enable fork_exec support on Windows

2018-11-19 Thread Samuel Thibault
g_spawn_async_with_fds is portable on Windows, so we can now enable fork_exec support there. Thanks Daniel P. Berrangé for the notice! Signed-off-by: Samuel Thibault --- slirp/misc.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/slirp/misc.c b/slirp/misc.c

Re: [Qemu-devel] [PATCH for-3.2 12/41] slirp: remove the disabled readv()/writev() code path

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:46:46 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:14PM +0400, Marc-André Lureau wrote: > > The soread() function may be used on datagram sockets, and would > > provide different behaviour if HAVE_READV was set, on empty datagrams. > > This looks like

Re: [Qemu-devel] [PATCH for-3.2 11/41] slirp: remove FULL_BOLT

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:46:02 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:13PM +0400, Marc-André Lureau wrote: > > Looking at git history, this looks like something from the past, when > > there was a tty layer. Let's remove it. > > > > Signed-off-by: Marc-André Lureau >

Re: [Qemu-devel] [PATCH for-3.2 10/41] slirp: remove PROBE_CONN dead-code

2018-11-19 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 14 nov. 2018 14:12:04 +0100, a ecrit: > On 14/11/18 13:36, Marc-André Lureau wrote: > > Nobody cares for over 14y. Somebody can revert or rewrite if > > interested by that. > > > > Signed-off-by: Marc-André Lureau > > Reviewed-by: Philippe Mathieu-Daudé Daniel

Re: [Qemu-devel] [PATCH for-3.2 07/41] slirp: add clock_get_ns() callback

2018-11-19 Thread Samuel Thibault
Paolo Bonzini, le jeu. 15 nov. 2018 13:54:02 +0100, a ecrit: > On 14/11/2018 13:36, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/libslirp.h | 6 ++ > > net/slirp.c | 19 +++ > > slirp/if.c | 2 +- > > slirp/ip6_icmp.c | 6

Re: [Qemu-devel] [PATCH for-3.2 05/41] slirp: use a callback structure to interface with qemu

2018-11-19 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 14 nov. 2018 14:10:15 +0100, a ecrit: > With the const qualifier: > Reviewed-by: Philippe Mathieu-Daudé Stefan Hajnoczi, le mer. 14 nov. 2018 14:30:14 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:07PM +0400, Marc-André Lureau wrote: > > -typedef void

Re: [Qemu-devel] [PATCH for-3.2 04/41] slirp: remove unused M_TRAILINGSPACE

2018-11-19 Thread Samuel Thibault
Daniel P. Berrangé, le mer. 14 nov. 2018 13:32:57 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:06PM +0400, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > slirp/mbuf.h | 1 - > > 1 file changed, 1 deletion(-) > > Reviewed-by: Daniel P. Berrangé Applied to my tree,

Re: [Qemu-devel] [PATCH for-3.2 03/41] slirp: simplify fork_exec()

2018-11-19 Thread Samuel Thibault
Hello, Daniel P. Berrangé, le mer. 14 nov. 2018 14:22:34 +, a ecrit: > On Wed, Nov 14, 2018 at 04:36:05PM +0400, Marc-André Lureau wrote: > > Use g_spawn_async_with_fds() to setup the child. > > > > GSpawn handles reaping the child, and closing parent file descriptors. > > The g_spawn*

Re: [Qemu-devel] [PATCH for-3.2 03/41] slirp: simplify fork_exec()

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:05 +0400, a ecrit: > Use g_spawn_async_with_fds() to setup the child. > > GSpawn handles reaping the child, and closing parent file descriptors. > > Signed-off-by: Marc-André Lureau Applied to my slirp-2 tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 02/41] glib-compat: add g_spawn_async_with_fds() fallback

2018-11-19 Thread Samuel Thibault
Marc-André Lureau, le mer. 14 nov. 2018 16:36:04 +0400, a ecrit: > Signed-off-by: Marc-André Lureau Reviewed-by: Samuel Thibault include/glib-compat.h maintainers, may I keep this in my slirp tree, to be pushed to master when appropriate? Samuel > --- > include/glib-comp

Re: [Qemu-devel] [PATCH for-3.2 01/41] slirp: move socket pair creation in helper function

2018-11-19 Thread Samuel Thibault
Hello, Marc-André Lureau, le mer. 14 nov. 2018 16:36:03 +0400, a ecrit: > Originally, the patch was fixing a bunch of issues, but Peter beat me > to it with earlier commit "slirp: fork_exec(): create and connect > child socket before fork()". > > Factor out socket pair creation, to simplify the

Re: [Qemu-devel] [PATCH] slirp: add tftp tracing

2018-11-13 Thread Samuel Thibault
Gerd Hoffmann, le mar. 13 nov. 2018 08:03:20 +0100, a ecrit: > Useful when debugging pxeboot, to see what the guest tries to do. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH] slirp: remove dead declarations

2018-11-12 Thread Samuel Thibault
Marc-André Lureau, le mar. 13 nov. 2018 00:26:39 +0400, a ecrit: > An overdue cleanup. Remaining declarations could probably be moved in > other headers, such as slirp.h. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 11/13] slirp: replace the poor-man string split with g_strsplit()

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:46 +0400, a ecrit: > Use the glib function for the work, fix a potential crash on >256 words. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 09/13] slirp: fix slirp_add_exec() leaks

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:44 +0400, a ecrit: > Free the list elements allocated in add_exec(). Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 08/13] slirp: remove Monitor dependency, return a string for info

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:43 +0400, a ecrit: > There is nothing performance-sensitive in returning an allocated > string for info, and handling the monitor_printf() on the caller side. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 07/13] slirp: move internal function declarations

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:42 +0400, a ecrit: > Clarify that those functions are internal to slirp. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 06/13] slirp: rename /extra/chardev

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:41 +0400, a ecrit: > Now it's only used for the chardev pointer. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 05/13] slirp: remove unused EMU_RSH

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:40 +0400, a ecrit: > EMU_RSH handling was dropped in commit > 0d62c4cfe21752df4c1d6e2c2398f15d5eaa794a. > > The assignment, and subsequent free() of ex_ptr->ex_exec to so->extra > looks unsafe (double free is likely to occur). Applied to my tree,

Re: [Qemu-devel] [PATCH for-3.2 04/13] slirp: use a dedicated field for chardev pointer

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:39 +0400, a ecrit: > Let's not mix command line and chardev pointers. Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 03/13] slirp: replace ex_pty with ex_chardev

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:38 +0400, a ecrit: > do_pty == 3 means to talk to a chardev. Applied to my tree, thanks!

Re: [Qemu-devel] [PATCH for-3.2 10/13] slirp: improve subprocess socket creation

2018-11-10 Thread Samuel Thibault
Peter Maydell, le sam. 10 nov. 2018 14:04:10 +, a ecrit: > On 10 November 2018 at 13:53, Samuel Thibault wrote: > > Marc-André Lureau, le sam. 10 nov. 2018 17:45:45 +0400, a ecrit: > >> @@ -163,23 +183,14 @@ fork_exec(struct socket *so, const char *ex) > &g

[Qemu-devel] [PULL 0/4] slirp updates

2018-11-10 Thread Samuel Thibault
The following changes since commit 160e5c22e55b3f775c2003dfc626fa872ee4a7a1: Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2018-11-09 10:54:10 +) are available in the Git repository at: https://people.debian.org/~sthibault/qemu.git tags/samuel-thibault

[Qemu-devel] [PULL 1/4] slirp: Don't pass possibly -1 fd to send()

2018-11-10 Thread Samuel Thibault
il slirp_send(). Signed-off-by: Peter Maydell Signed-off-by: Samuel Thibault --- slirp/slirp.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/slirp/slirp.c b/slirp/slirp.c index 51de41fc02..3c3c03b22f 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -1091,6 +1091,17 @@ ssize_t

[Qemu-devel] [PULL 2/4] slirp: Use g_new() to allocate sockets in socreate()

2018-11-10 Thread Samuel Thibault
From: Peter Maydell The slirp socreate() function can only fail if the attempt to malloc() the struct socket fails. Switch to using g_new() instead, which will allow us to remove the error-handling code from its callers. Signed-off-by: Peter Maydell Signed-off-by: Samuel Thibault --- slirp

Re: [Qemu-devel] [PATCH for-3.2 02/13] slirp: remove do_pty from fork_exec()

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:37 +0400, a ecrit: > QEMU uses fork_exec() with do_pty values 0 or 3. > Let's clean up some unused code. Applied to my tree, thanks! > Signed-off-by: Marc-André Lureau > --- > slirp/misc.h | 2 +- > slirp/misc.c | 55

[Qemu-devel] [PULL 4/4] slirp: fork_exec(): create and connect child socket before fork()

2018-11-10 Thread Samuel Thibault
to handle a possible failure. Signed-off-by: Peter Maydell Signed-off-by: Samuel Thibault --- slirp/misc.c | 55 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/slirp/misc.c b/slirp/misc.c index 260187b6b6..57bdd808e2 100644

[Qemu-devel] [PULL 3/4] slirp: Remove code that handles socreate() failure

2018-11-10 Thread Samuel Thibault
ept() call fails then we pass closesocket() -1 instead of a valid file descriptor. Signed-off-by: Peter Maydell Signed-off-by: Samuel Thibault --- slirp/ip_icmp.c | 2 +- slirp/slirp.c | 3 --- slirp/socket.c| 3 --- slirp/tcp_input.c | 3 +-- slirp/tcp_subr.c | 5 - slirp/udp.c

Re: [Qemu-devel] [PATCH for-3.2 01/13] slirp: associate slirp_output callback with the Slirp context

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:36 +0400, a ecrit: > Let's make the slirp interface a bit more library-like. > Associate the slirp_output() with a Slirp context. > > Signed-off-by: Marc-André Lureau Applied to my tree, thanks! Samuel

Re: [Qemu-devel] [PATCH for-3.2 13/13] slirp: simplify fork_exec()

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:48 +0400, a ecrit: > Use g_spawn_async_with_fds() to setup the child. > > GSpawn handles reaping the child, and closing parent file descriptors. Similarly :) Samuel

Re: [Qemu-devel] [PATCH for-3.2 10/13] slirp: improve subprocess socket creation

2018-11-10 Thread Samuel Thibault
Marc-André Lureau, le sam. 10 nov. 2018 17:45:45 +0400, a ecrit: > @@ -163,23 +183,14 @@ fork_exec(struct socket *so, const char *ex) > exit(1); > >default: > - qemu_add_child_watch(pid); > -/* > - * XXX this could block us... > -

Re: [Qemu-devel] [PATCH for-3.1 3/4] slirp: Remove code that handles socreate() failure

2018-11-06 Thread Samuel Thibault
Peter Maydell, le mar. 06 nov. 2018 15:13:22 +, a ecrit: > Now that socreate() can never fail, we can remove the code > that was trying to handle that situation. > > In particular this removes code in tcp_connect() that > provoked Coverity to complain (CID 1005724): in >

Re: [Qemu-devel] [PATCH for-3.1 4/4] slirp: fork_exec(): create and connect child socket before fork()

2018-11-06 Thread Samuel Thibault
Peter Maydell, le mar. 06 nov. 2018 15:13:23 +, a ecrit: > Currently fork_exec() fork()s, and then creates and connects the > child socket which it uses for communication with the parent in > the child process. This is awkward because the child has no > mechanism to report failure back to the

Re: [Qemu-devel] [PATCH for-3.1 2/4] slirp: Use g_new() to allocate sockets in socreate()

2018-11-06 Thread Samuel Thibault
Peter Maydell, le mar. 06 nov. 2018 15:13:21 +, a ecrit: > The slirp socreate() function can only fail if the attempt > to malloc() the struct socket fails. Switch to using > g_new() instead, which will allow us to remove the > error-handling code from its callers. > > Signed-off-by: Peter

Re: [Qemu-devel] [PATCH for-3.1 1/4] slirp: Don't pass possibly -1 fd to send()

2018-11-06 Thread Samuel Thibault
Peter Maydell, le mar. 06 nov. 2018 15:13:20 +, a ecrit: > Coverity complains (CID 1005726) that we might pass -1 as the fd > argument to send() in slirp_send(), because we previously checked for > "so->s == -1 && so->extra". The case of "so->s == -1 but so->extra > NULL" should not in theory

Re: [Qemu-devel] [PATCH RFC 1/4] slirp: add helper for tcp6 socket creation

2018-10-30 Thread Samuel Thibault
Maxim Samoylov, le mar. 30 oct. 2018 16:58:17 +0300, a ecrit: > On 27.10.2018 14:11, Samuel Thibault wrote: > > Is there a reason why you set SO_OOBINLINE, but not TCP_NODELAY? That's > > the kind of discrepancy we don't want to let unseen, thus the reason for > > a

Re: [Qemu-devel] [PATCH RFC 4/4] net/slirp: add ipv6-hostfwd option for user netdev type

2018-10-27 Thread Samuel Thibault
Maxim Samoylov, le ven. 26 oct. 2018 03:03:43 +0300, a ecrit: > +void hmp_ipv6_hostfwd_remove(Monitor *mon, const QDict *qdict) > +{ Similarly, a lot can be shared, by introducing const char *hmp_hostfwd_lookup(Monitor *mon, const QDict *qdict, int is_v6) which will contain all the lookup and

Re: [Qemu-devel] [PATCH RFC 3/4] slirp: add helpers for ipv6 hostfwd manipulation

2018-10-27 Thread Samuel Thibault
Hello, Maxim Samoylov, le ven. 26 oct. 2018 03:03:42 +0300, a ecrit: > +int slirp_remove_ipv6_hostfwd(Slirp *slirp, int is_udp, > + struct in6_addr host_addr, int host_port) Similarly, we'd rather share the code than duplicate it :) Better put the existing

Re: [Qemu-devel] [PATCH RFC 2/4] slirp: add helper for udp6 socket creation

2018-10-27 Thread Samuel Thibault
Ditto :) Samuel

<    2   3   4   5   6   7   8   9   10   11   >