Re: [Qemu-devel] [PATCH 02/27] net/slirp: simplify checking for cmd: prefix

2019-01-26 Thread Samuel Thibault
Marc-André Lureau, le jeu. 17 janv. 2019 15:43:34 +0400, a ecrit: > Signed-off-by: Marc-André Lureau It's not strictly the same (g_str_has_prefix doesn't test that there are characters after the prefix), but that should be fine, applied, thanks!

Re: [Qemu-devel] [PATCH 01/27] slirp: generalize guestfwd with a callback based approach

2019-01-26 Thread Samuel Thibault
Marc-André Lureau, le jeu. 17 janv. 2019 15:43:33 +0400, a ecrit: > Instead of calling into QEMU chardev directly, and mixing it with > slirp_add_exec() handling, add a new function slirp_add_guestfwd() > which takes a write callback. > > Signed-off-by: Marc-André Lureau applied, thanks!

[Qemu-devel] [PULL 2/3] slirp: Avoid marking naturally packed structs as QEMU_PACKED

2019-01-26 Thread Samuel Thibault
the address of fields within the structs without risking undefined behaviour, and suppresses clang -Waddress-of-packed-member warnings. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Signed-off-by: Samuel Thibault --- slirp/ip6.h | 12 ++-- slirp/ip6_icmp.h | 20

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

2019-01-26 Thread Samuel Thibault
/samuel-thibault for you to fetch changes up to 4956f29c43c2105dc37ee9826959b3aa1d3b0b69: slirp: Don't mark struct ipq or struct ipasfrag as packed (2019-01-26 22:09:48 +0100) slirp updates Peter Maydell (2): slirp: Avoid marking

[Qemu-devel] [PULL 3/3] slirp: Don't mark struct ipq or struct ipasfrag as packed

2019-01-26 Thread Samuel Thibault
ipasfrag, as documented in the comment on that struct; assert at build time that this is the case. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Signed-off-by: Samuel Thibault --- slirp/ip.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index

[Qemu-devel] [PULL 1/3] slirp: Avoid unaligned 16bit memory access

2019-01-26 Thread Samuel Thibault
pkt parameter may be unaligned, so we must access it byte-wise. This fixes sparc64 host SIGBUS during pxe boot. Signed-off-by: Samuel Thibault Reviewed-by: Richard Henderson --- slirp/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/slirp.c b/slirp/slirp.c

Re: [Qemu-devel] [PATCH 0/2] slirp: fix -Waddress-of-packed-member warnings

2019-01-26 Thread Samuel Thibault
Hello, Peter Maydell, le mar. 22 janv. 2019 18:18:20 +, a ecrit: > These patches fix the clang -Waddress-of-packed-member warnings > in the slirp code. Applied to my tree, thanks! Eric Blake, le mar. 22 janv. 2019 13:27:32 -0600, a ecrit: > How does this series play with the ongoing effort

Re: [Qemu-devel] [PATCH 00/27] slirp: make it again a standalone project (part 2)

2019-01-17 Thread Samuel Thibault
Also thinking about it: I guess we'd want to make the usage of libslirp optional, at least because (I guess) at some points the future libslirp may want to change the API (nobody can do something perfect at first try), and when that breaks qemu build it would nasty if people couldn't just disable

Re: [Qemu-devel] [PATCH 01/27] slirp: generalize guestfwd with a callback based approach

2019-01-17 Thread Samuel Thibault
Marc-André Lureau, le jeu. 17 janv. 2019 15:43:33 +0400, a ecrit: > /* XXX this blocks entire thread. Rewrite to use > * qemu_chr_fe_write and background I/O callbacks */ Seeing this, I guess a whole pass will be useful to turn these qemu comment references into something that

Re: [Qemu-devel] [PATCH 21/27] slirp: prefer c99 types over BSD kind

2019-01-17 Thread Samuel Thibault
Marc-André Lureau, le jeu. 17 janv. 2019 15:43:53 +0400, a ecrit: > (indentation mess is hopefully going to be fixed when slirp is made a > separate project and clang-format is applied over the history) Yes, let's do it :) Samuel

Re: [Qemu-devel] [PATCH] slirp: Use lduw_be_p in slirp_input

2019-01-17 Thread Samuel Thibault
Philippe Mathieu-Daudé, le jeu. 17 janv. 2019 14:16:16 +0100, a ecrit: > On 1/17/19 12:50 AM, Samuel Thibault wrote: > > Hello, > > > > Richard Henderson, le mer. 26 déc. 2018 14:42:54 +1100, a ecrit: > >> The pointer may be unaligned, so we must use our routines f

Re: [Qemu-devel] [PATCH] slirp: Use lduw_be_p in slirp_input

2019-01-16 Thread Samuel Thibault
t SIGBUS during pxe boot. Signed-off-by: Samuel Thibault diff --git a/slirp/slirp.c b/slirp/slirp.c index ab2fc4eb8b..0e41d5aedf 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -851,7 +851,7 @@ void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) if (pkt_len < ETH_HLE

[Qemu-devel] [PULL 62/65] slirp: set G_LOG_DOMAIN

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/Makefile.objs | 2 ++ 1 file changed, 2

[Qemu-devel] [PULL 56/65] slirp: use %p for pointers format

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau This fixes some compilation warnings on mingw64. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/ip6_icmp.c | 2 +- slirp/ip6_input.c | 2 +- slirp/ip6_output.c | 4 ++-- slirp/udp6.c | 6 +++--- 4 files changed, 7 insertions(+), 7

[Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/misc.c | 8 slirp/slirp.c | 15 +++ 2 files changed, 15 insertions(+), 8

[Qemu-devel] [PULL 53/65] slirp: no need to make DPRINTF conditional on DEBUG

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau DEBUG_CALL is already handled conditionally. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/bootp.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/slirp/bootp.c b/slirp/bootp.c index 5ab6692038..4c9a77eb98 100644

[Qemu-devel] [PULL 48/65] slirp: rename exec_list

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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é Lureau Signed-off-by: Samuel Thibault

[Qemu-devel] [PULL 50/65] slirp: replace a fprintf with g_critical()

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/socket.c

[Qemu-devel] [PULL 61/65] build-sys: use a separate slirp-obj-y && slirp.mo

2019-01-14 Thread Samuel Thibault
to build with net/slirp.o (CONFIG_SLIRP would need to be 'm') and other build issues. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- Makefile| 5 +++-- Makefile.objs | 3 +-- Makefile.target | 5 - slirp/Makefile.objs | 35

[Qemu-devel] [PULL 43/65] glib-compat: add g_spawn_async_with_fds() fallback

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- include/glib-compat.h | 56 +++ 1 file changed, 56 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index fdf95a255d..8a078c5288 100644

[Qemu-devel] [PULL 65/65] slirp: check data length while emulating ident function

2019-01-14 Thread Samuel Thibault
From: Prasad J Pandit While emulating identification protocol, tcp_emu() does not check available space in the 'sc_rcv->sb_data' buffer. It could lead to heap buffer overflow issue. Add check to avoid it. Reported-by: Kira <864786...@qq.com> Signed-off-by: Prasad J Pandit Signed-off-b

[Qemu-devel] [PULL 37/65] slirp: remove #if notdef dead code

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/ip_input.c | 200 -- slirp/tcp_input.c | 39 - 2 files changed, 239 deletions(-) diff --git a/slirp

[Qemu-devel] [PULL 64/65] slirp: Mark debugging calls as unlikely

2019-01-14 Thread Samuel Thibault
to get them out of the hot path. Signed-off-by: Samuel Thibault Reviewed-by: Marc-André Lureau --- slirp/debug.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slirp/debug.h b/slirp/debug.h index 25a5d59439..269d97d807 100644 --- a/slirp/debug.h +++ b/slirp/debug.h

[Qemu-devel] [PULL 32/65] slirp: replace compile time DO_KEEPALIVE

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Use a global variable instead (similar to slirp_debug) Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/slirp.c| 3 +++ slirp/slirp.h| 6 +++--- slirp/slirp_config.h | 12 slirp/tcp_input.c| 2 +- slirp

[Qemu-devel] [PULL 63/65] slirp: call into g_debug() for DEBUG macros

2019-01-14 Thread Samuel Thibault
ROR calls to not need \n ending. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/cksum.c | 4 ++-- slirp/debug.h | 17 - slirp/dhcpv6.c | 6 +++--- slirp/ip_icmp.c| 10 +- slirp/slirp.c | 10 --

[Qemu-devel] [PULL 58/65] slirp: replace DEBUG_ARGS with DEBUG_ARG

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/arp_table.c | 12 ++-- slirp/debug.h | 2 -- slirp

[Qemu-devel] [PULL 59/65] slirp: factor out guestfwd addition checks

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau This will allow reusing the function in a following patch. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.c | 7 --- slirp/slirp.c | 23 +-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/slirp

[Qemu-devel] [PULL 33/65] slirp: remove unused global slirp_instance

2019-01-14 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 | 2 -- 1 file changed, 2 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index 05c203c8c7..d1b6bcefbb 100644 --- a/slirp/slirp.h +++ b/slirp

[Qemu-devel] [PULL 57/65] slirp: remove remaining DEBUG blocks

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/cksum.c | 4 slirp/ip_icmp.c | 5 ++--- slirp

[Qemu-devel] [PULL 47/65] slirp: drop

2019-01-14 Thread Samuel Thibault
://sourceforge.net/p/mingw-w64/mailman/message/36473782/ We could workaround it by declaring it ourself depending on __MINGW64_VERSION_*: WINSOCK_API_LINKAGE INT WSAAPI inet_pton(int Family, PCTSTR pszAddrString, PVOID pAddrBuf); Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net

[Qemu-devel] [PULL 54/65] slirp: always build with debug statements

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/debug.h

[Qemu-devel] [PULL 27/65] slirp: remove HAVE_SYS_FILIO_H

2019-01-14 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| 2 +- slirp/slirp_config.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index

[Qemu-devel] [PULL 46/65] slirp: Enable fork_exec support on Windows

2019-01-14 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 Reviewed-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- slirp/misc.c | 14 ++ 1 file changed, 2

[Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp

[Qemu-devel] [PULL 60/65] slirp: add clock_get_ns() callback

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 6 ++ slirp/if.c | 2 +- slirp/ip6_icmp.c | 4 ++-- slirp/libslirp.h | 2 ++ slirp/slirp.c| 12 +--- 5 files changed, 16 insertions(+), 10 deletions

[Qemu-devel] [PULL 29/65] slirp: remove unused HAVE_INET_ATON

2019-01-14 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_config.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h index 833f25a965..5126711849 100644

[Qemu-devel] [PULL 34/65] slirp: replace error_report() with g_critical()

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Reduce dependency on QEMU. QEMU could use a custom log handler if it wants to redirect/filter it. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/ip6_icmp.c | 2 +- slirp/misc.c | 2 +- slirp/slirp.c| 6 +++--- 3 files changed, 5

[Qemu-devel] [PULL 49/65] slirp: use virtual time for packet expiration

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Make all packets expiration time based on virtual clock. Suggested-by: Paolo Bonzini Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/if.c| 2 +- slirp/slirp.c | 7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PULL 25/65] slirp: remove unused HAVE_SYS_SELECT_H

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/main.h | 4 slirp/slirp.h| 4 slirp/slirp_config.h | 6 -- 3 files changed, 14 deletions(-) diff --git a/slirp/main.h b/slirp

[Qemu-devel] [PULL 44/65] slirp: simplify fork_exec()

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/misc.c | 75 +--- 1 file

[Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Remove some clutter, and avoids direct call to fprintf(). Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/slirp.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index

[Qemu-devel] [PULL 39/65] slirp: NULL is defined by stddef.h

2019-01-14 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 1 file changed, 4 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index d1b6bcefbb..fdf397256b 100644 --- a/slirp/slirp.h +++ b/slirp

[Qemu-devel] [PULL 42/65] net: do not depend on slirp internals

2019-01-14 Thread Samuel Thibault
-by: Samuel Thibault --- net/colo-compare.c| 11 + net/colo.c| 1 + net/colo.h| 7 +++--- net/filter-rewriter.c | 9 +++ net/slirp.c | 2 +- net/util.h| 55 +++ stubs/slirp.c | 2 +- 7 files

[Qemu-devel] [PULL 38/65] slirp: remove unused sbflush()

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/sbuf.h | 1 - 1 file changed, 1 deletion(-) diff --git a/slirp/sbuf.h b/slirp/sbuf.h index a722ecb629..644c201341 100644 --- a/slirp/sbuf.h +++ b/slirp/sbuf.h

[Qemu-devel] [PULL 22/65] slirp: remove unused HAVE_SYS_STROPTS_H

2019-01-14 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| 5 - slirp/slirp_config.h | 3 --- 2 files changed, 8 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index fba77d0c3d..400f585cec

[Qemu-devel] [PULL 35/65] slirp: improve a bit the debug macros

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Let them accept multiple arguments. Simplify the inner argument handling of DEBUG_ARGS/DEBUG_MISC_DEBUG_ERROR. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/arp_table.c | 12 ++-- slirp/bootp.c | 3 +-- slirp/cksum.c

[Qemu-devel] [PULL 45/65] slirp: replace error_report() with g_critical()

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Reduce dependency on QEMU. QEMU could use a custom log handler if it wants to redirect/filter it. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/misc.c b/slirp

[Qemu-devel] [PULL 31/65] slirp: replace SIZEOF_CHAR_P with glib equivalent

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Thibault --- slirp/ip.h | 2 +- slirp/slirp_config.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index 83fc9cdfbf

[Qemu-devel] [PULL 40/65] slirp: remove dead TCP_ACK_HACK code

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Untouched since original introduction in 2004. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/tcp_input.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/slirp

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

2019-01-14 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 23/65] slirp: remove unused HAVE_ARPA_INET_H

2019-01-14 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_config.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h index 47811e36dc..e95284071a 100644

[Qemu-devel] [PULL 41/65] slirp: replace ARRAY_SIZE with G_N_ELEMENTS

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Do not require QEMU macro. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/ncsi.c | 2 +- slirp/tftp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff

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

2019-01-14 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 19/65] slirp: remove HAVE_SYS_SIGNAL_H

2019-01-14 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 17/65] slirp: remove FULL_BOLT

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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 Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/if.c | 2 -- slirp/slirp_config.h | 7

[Qemu-devel] [PULL 28/65] slirp: remove unused DECLARE_IOVEC

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau It's actually qemu configure CONFIG_IOVEC that is being used. slirp/ does not use it anyway Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/slirp_config.h | 6 -- 1 file changed, 6 deletions(-) diff

[Qemu-devel] [PULL 36/65] slirp: add a callback to log guest errors

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 7 +++ slirp/dhcpv6.c | 6 +++--- slirp/ip6_icmp.c | 7 +++ slirp/libslirp.h | 2 ++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/net/slirp.c b/net

[Qemu-devel] [PULL 10/65] slirp: replace the poor-man string split with g_strsplit()

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Use the glib function for the work, fix a potential crash on >256 words. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/slirp/misc.c b/sl

[Qemu-devel] [PULL 30/65] slirp: replace HOST_WORDS_BIGENDIAN with glib equivalent

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau One more step towards making the project independent from QEMU. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/ip.h | 8 +--- slirp/ip6.h | 3

[Qemu-devel] [PULL 26/65] slirp: remove HAVE_SYS_IOCTL_H

2019-01-14 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| 2 +- slirp/slirp_config.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index

[Qemu-devel] [PULL 21/65] slirp: remove NO_UNIX_SOCKETS

2019-01-14 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 | 6 -- 2 files changed, 9 deletions(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index 57955a8965..fba77d0c3d

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

2019-01-14 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 18/65] slirp: remove the disabled readv()/writev() code path

2019-01-14 Thread Samuel Thibault
-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/slirp_config.h | 3 --- slirp/socket.c | 15 --- 2 files changed, 18 deletions(-) diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h index f0cc1c781b..3ce64e088e 100644 --- a/slirp/slirp_config.h +++ b/slirp

[Qemu-devel] [PULL 16/65] slirp: remove PROBE_CONN dead-code

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau 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é Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/slirp.c| 41

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

2019-01-14 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 07/65] slirp: move internal function declarations

2019-01-14 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 15/65] slirp: use a callback structure to interface with qemu

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau This will bring slirp a bit forward to the state of an independent project. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Thibault --- net/slirp.c | 6 +- slirp/libslirp.h | 13 +++-- slirp/ncsi.c

[Qemu-devel] [PULL 08/65] slirp: remove Monitor dependency, return a string for info

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau There is nothing performance-sensitive in returning an allocated string for info, and handling the monitor_printf() on the caller side. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 7 --- slirp/libslirp.h | 2 +- slirp

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

2019-01-14 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] [PULLv3 00/65] slirp updates

2019-01-14 Thread Samuel Thibault
/samuel-thibault for you to fetch changes up to a7104eda7dab99d0cdbd3595c211864cba415905: slirp: check data length while emulating ident function (2019-01-14 23:36:38 +0100) slirp updates Gerd Hoffmann (1): slirp: add tftp tracing

[Qemu-devel] [PULL 11/65] slirp: remove dead declarations

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau An overdue cleanup. Remaining declarations could probably be moved in other headers, such as slirp.h. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/main.h | 29 - 1 file changed, 29 deletions(-) diff --git

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

2019-01-14 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 20/65] slirp: remove unused HAVE_SYS_BITYPES_H

2019-01-14 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 4c3c672ee6..57955a8965

[Qemu-devel] [PULL 14/65] slirp: remove unused M_TRAILINGSPACE

2019-01-14 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/mbuf.h | 1 - 1 file changed, 1 deletion(-) diff --git a/slirp/mbuf.h b/slirp/mbuf.h index bfdf8c4577..cbf17e136b 100644 --- a/slirp/mbuf.h +++ b/slirp/mbuf.h

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

2019-01-14 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 09/65] slirp: fix slirp_add_exec() leaks

2019-01-14 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 02/65] slirp: remove do_pty from fork_exec()

2019-01-14 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

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

2019-01-14 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

Re: [Qemu-devel] [PULLv2 00/65] slirp updates

2019-01-13 Thread Samuel Thibault
no-re...@patchew.org, le dim. 13 janv. 2019 19:16:44 -0800, a ecrit: > This series failed the docker-mingw@fedora build test. Please find the > testing commands and > their output below. If you have Docker installed, you can probably reproduce > it > locally. > > === TEST SCRIPT BEGIN === >

[Qemu-devel] [PULL 61/65] build-sys: use a seperate slirp-obj-y && slirp.mo

2019-01-13 Thread Samuel Thibault
to build with net/slirp.o (CONFIG_SLIRP would need to be 'm') and other build issues. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- Makefile.objs | 3 +-- Makefile.target | 5 - slirp/Makefile.objs | 35 ++- 3 files changed, 35

[Qemu-devel] [PULL 63/65] slirp: call into g_debug() for DEBUG macros

2019-01-13 Thread Samuel Thibault
ROR calls to not need \n ending. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/cksum.c | 4 ++-- slirp/debug.h | 17 - slirp/dhcpv6.c | 6 +++--- slirp/ip_icmp.c| 10 +- slirp/slirp.c | 10 --

[Qemu-devel] [PULL 58/65] slirp: replace DEBUG_ARGS with DEBUG_ARG

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/arp_table.c | 12 ++-- slirp/debug.h | 2 -- slirp

[Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp

[Qemu-devel] [PULL 65/65] slirp: check data length while emulating ident function

2019-01-13 Thread Samuel Thibault
From: Prasad J Pandit While emulating identification protocol, tcp_emu() does not check available space in the 'sc_rcv->sb_data' buffer. It could lead to heap buffer overflow issue. Add check to avoid it. Reported-by: Kira <864786...@qq.com> Signed-off-by: Prasad J Pandit Signed-off-b

[Qemu-devel] [PULL 64/65] slirp: Mark debugging calls as unlikely

2019-01-13 Thread Samuel Thibault
to get them out of the hot path. Signed-off-by: Samuel Thibault Reviewed-by: Marc-André Lureau --- slirp/debug.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slirp/debug.h b/slirp/debug.h index 25a5d59439..269d97d807 100644 --- a/slirp/debug.h +++ b/slirp/debug.h

[Qemu-devel] [PULL 62/65] slirp: set G_LOG_DOMAIN

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/Makefile.objs | 2 ++ 1 file changed, 2

[Qemu-devel] [PULL 48/65] slirp: rename exec_list

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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é Lureau Signed-off-by: Samuel Thibault

[Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/misc.c | 8 slirp/slirp.c | 15 +++ 2 files changed, 15 insertions(+), 8

[Qemu-devel] [PULL 50/65] slirp: replace a fprintf with g_critical()

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/socket.c

[Qemu-devel] [PULL 40/65] slirp: remove dead TCP_ACK_HACK code

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau Untouched since original introduction in 2004. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Signed-off-by: Samuel Thibault --- slirp/tcp_input.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/slirp

[Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau Remove some clutter, and avoids direct call to fprintf(). Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/slirp.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index

[Qemu-devel] [PULL 46/65] slirp: Enable fork_exec support on Windows

2019-01-13 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 Reviewed-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- slirp/misc.c | 14 ++ 1 file changed, 2

[Qemu-devel] [PULL 57/65] slirp: remove remaining DEBUG blocks

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau 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 Signed-off-by: Samuel Thibault --- slirp/cksum.c | 4 slirp/ip_icmp.c | 5 ++--- slirp

[Qemu-devel] [PULL 59/65] slirp: factor out guestfwd addition checks

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau This will allow reusing the function in a following patch. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.c | 7 --- slirp/slirp.c | 23 +-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/slirp

[Qemu-devel] [PULL 49/65] slirp: use virtual time for packet expiration

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau Make all packets expiration time based on virtual clock. Suggested-by: Paolo Bonzini Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/if.c| 2 +- slirp/slirp.c | 7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PULL 60/65] slirp: add clock_get_ns() callback

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 6 ++ slirp/if.c | 2 +- slirp/ip6_icmp.c | 4 ++-- slirp/libslirp.h | 2 ++ slirp/slirp.c| 12 +--- 5 files changed, 16 insertions(+), 10 deletions

[Qemu-devel] [PULL 36/65] slirp: add a callback to log guest errors

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 7 +++ slirp/dhcpv6.c | 6 +++--- slirp/ip6_icmp.c | 7 +++ slirp/libslirp.h | 2 ++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/net/slirp.c b/net

[Qemu-devel] [PULL 56/65] slirp: use %p for pointers format

2019-01-13 Thread Samuel Thibault
From: Marc-André Lureau This fixes some compilation warnings on mingw64. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/ip6_icmp.c | 2 +- slirp/ip6_input.c | 2 +- slirp/ip6_output.c | 4 ++-- slirp/udp6.c | 6 +++--- 4 files changed, 7 insertions(+), 7

[Qemu-devel] [PULL 47/65] slirp: drop

2019-01-13 Thread Samuel Thibault
://sourceforge.net/p/mingw-w64/mailman/message/36473782/ We could workaround it by declaring it ourself depending on __MINGW64_VERSION_*: WINSOCK_API_LINKAGE INT WSAAPI inet_pton(int Family, PCTSTR pszAddrString, PVOID pAddrBuf); Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net

[Qemu-devel] [PULL 29/65] slirp: remove unused HAVE_INET_ATON

2019-01-13 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_config.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h index 833f25a965..5126711849 100644

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