mbox

[PULL,00/31] More work towards libslirp

Message ID 20190127120526.15457-1-samuel.thibault@ens-lyon.org (mailing list archive)
State New, archived
Headers show

Pull-request

https://people.debian.org/~sthibault/qemu.git tags/samuel-thibault

Message

Samuel Thibault Jan. 27, 2019, 12:04 p.m. UTC
The following changes since commit ad7a21e81231ae64540310384fb0f87ac8758b02:

  Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging (2019-01-25 17:22:20 +0000)

are available in the Git repository at:

  https://people.debian.org/~sthibault/qemu.git tags/samuel-thibault

for you to fetch changes up to 10163f695fe66f9d3d099a33752996dae70be98c:

  slirp: API is extern C (2019-01-27 13:03:59 +0100)

----------------------------------------------------------------
More work towards libslirp

Marc-André Lureau (27):
  slirp: generalize guestfwd with a callback based approach
  net/slirp: simplify checking for cmd: prefix
  net/slirp: free forwarding rules on cleanup
  net/slirp: fix leaks on forwarding rule registration error
  slirp: add callbacks for timer
  slirp: replace trace functions with DEBUG calls
  slirp: replace QEMU_PACKED with SLIRP_PACKED
  slirp: replace most qemu socket utilities with slirp own version
  slirp: replace qemu_set_nonblock()
  slirp: add unregister_poll_fd() callback
  slirp: replace qemu_notify_event() with a callback
  slirp: move QEMU state saving to a separate unit
  slirp: do not include qemu headers in libslirp.h public API header
  slirp: improve windows headers inclusion
  slirp: add slirp own version of pstrcpy
  slirp: remove qemu timer.h dependency
  slirp: remove now useless QEMU headers inclusions
  slirp: replace net/eth.h inclusion with own defines
  slirp: replace qemu qtailq with slirp own copy
  slirp: replace remaining qemu headers dependency
  slirp: prefer c99 types over BSD kind
  slirp: improve send_packet() callback
  slirp: replace global polling with per-instance & notifier
  slirp: remove slirp_instances list
  slirp: use polling callbacks, drop glib requirement
  slirp: pass opaque to all callbacks
  slirp: API is extern C

Peter Maydell (2):
  slirp: Avoid marking naturally packed structs as QEMU_PACKED
  slirp: Don't mark struct ipq or struct ipasfrag as packed

Samuel Thibault (2):
  slirp: Avoid unaligned 16bit memory access
  slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT

----------------------------------------------------------------
Marc-André Lureau (27):
      slirp: generalize guestfwd with a callback based approach
      net/slirp: simplify checking for cmd: prefix
      net/slirp: free forwarding rules on cleanup
      net/slirp: fix leaks on forwarding rule registration error
      slirp: add callbacks for timer
      slirp: replace trace functions with DEBUG calls
      slirp: replace QEMU_PACKED with SLIRP_PACKED
      slirp: replace most qemu socket utilities with slirp own version
      slirp: replace qemu_set_nonblock()
      slirp: add unregister_poll_fd() callback
      slirp: replace qemu_notify_event() with a callback
      slirp: move QEMU state saving to a separate unit
      slirp: do not include qemu headers in libslirp.h public API header
      slirp: improve windows headers inclusion
      slirp: add slirp own version of pstrcpy
      slirp: remove qemu timer.h dependency
      slirp: remove now useless QEMU headers inclusions
      slirp: replace net/eth.h inclusion with own defines
      slirp: replace qemu qtailq with slirp own copy
      slirp: replace remaining qemu headers dependency
      slirp: prefer c99 types over BSD kind
      slirp: improve send_packet() callback
      slirp: replace global polling with per-instance & notifier
      slirp: remove slirp_instances list
      slirp: use polling callbacks, drop glib requirement
      slirp: pass opaque to all callbacks
      slirp: API is extern C

Peter Maydell (2):
      slirp: Avoid marking naturally packed structs as QEMU_PACKED
      slirp: Don't mark struct ipq or struct ipasfrag as packed

Samuel Thibault (2):
      slirp: Avoid unaligned 16bit memory access
      slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT

 Makefile.objs            |   1 -
 include/net/net.h        |   2 +-
 include/qemu/main-loop.h |  15 +
 net/net.c                |   4 +-
 net/slirp.c              | 185 ++++++++-
 slirp/Makefile.objs      |   4 +-
 slirp/arp_table.c        |   1 -
 slirp/bootp.c            |   1 -
 slirp/cksum.c            |   1 -
 slirp/debug.h            |  13 +-
 slirp/dhcpv6.c           |   4 +-
 slirp/dnssearch.c        |   1 -
 slirp/if.c               |   4 +-
 slirp/ip.h               |  17 +-
 slirp/ip6.h              |  13 +-
 slirp/ip6_icmp.c         |  27 +-
 slirp/ip6_icmp.h         |  26 +-
 slirp/ip6_input.c        |   1 -
 slirp/ip6_output.c       |   2 -
 slirp/ip_icmp.c          |  14 +-
 slirp/ip_icmp.h          |  18 +-
 slirp/ip_input.c         |   5 +-
 slirp/ip_output.c        |   1 -
 slirp/libslirp.h         |  71 +++-
 slirp/main.h             |   2 +-
 slirp/mbuf.c             |   1 -
 slirp/mbuf.h             |   2 +-
 slirp/misc.c             |  64 ++--
 slirp/misc.h             |  15 +-
 slirp/ncsi.c             |   3 +-
 slirp/ndp_table.c        |   2 -
 slirp/qtailq.h           | 193 ++++++++++
 slirp/sbuf.c             |   8 +-
 slirp/sbuf.h             |   2 +-
 slirp/slirp.c            | 980 +++++++++++++++--------------------------------
 slirp/slirp.h            |  45 +--
 slirp/socket.c           |  33 +-
 slirp/socket.h           |   9 +-
 slirp/state.c            | 394 +++++++++++++++++++
 slirp/state.h            |   9 +
 slirp/tcp_input.c        |  29 +-
 slirp/tcp_output.c       |  13 +-
 slirp/tcp_subr.c         |  49 +--
 slirp/tcp_timer.c        |   3 +-
 slirp/tcp_var.h          |  14 +-
 slirp/tftp.c             |  16 +-
 slirp/trace-events       |   5 -
 slirp/udp.c              |  16 +-
 slirp/udp.h              |   2 +-
 slirp/udp6.c             |   2 -
 slirp/util.c             | 207 ++++++++++
 slirp/util.h             | 127 ++++++
 stubs/Makefile.objs      |   3 +-
 stubs/slirp.c            |  13 -
 util/main-loop.c         |  30 +-
 util/osdep.c             |   2 +-
 56 files changed, 1762 insertions(+), 962 deletions(-)
 create mode 100644 slirp/qtailq.h
 create mode 100644 slirp/state.c
 create mode 100644 slirp/state.h
 delete mode 100644 slirp/trace-events
 create mode 100644 slirp/util.c
 create mode 100644 slirp/util.h
 delete mode 100644 stubs/slirp.c

Comments

Peter Maydell Jan. 28, 2019, 3:44 p.m. UTC | #1
On Sun, 27 Jan 2019 at 12:13, Samuel Thibault
<samuel.thibault@ens-lyon.org> wrote:
>
> The following changes since commit ad7a21e81231ae64540310384fb0f87ac8758b02:
>
>   Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging (2019-01-25 17:22:20 +0000)
>
> are available in the Git repository at:
>
>   https://people.debian.org/~sthibault/qemu.git tags/samuel-thibault
>
> for you to fetch changes up to 10163f695fe66f9d3d099a33752996dae70be98c:
>
>   slirp: API is extern C (2019-01-27 13:03:59 +0100)
>
> ----------------------------------------------------------------
> More work towards libslirp

This fails to build on almost all hosts:

x86-64 linux ubuntu:

/home/petmay01/linaro/qemu-for-merges/slirp/misc.c: In function ‘fork_exec’:
/home/petmay01/linaro/qemu-for-merges/slirp/misc.c:139:5: error:
implicit declaration of function ‘g_spawn_async_with_fds’; did you
mean ‘g_spawn_async_with_pipes’?
[-Werror=implicit-function-declaration]
     g_spawn_async_with_fds(NULL /* cwd */,
     ^~~~~~~~~~~~~~~~~~~~~~
     g_spawn_async_with_pipes
/home/petmay01/linaro/qemu-for-merges/slirp/misc.c:139:5: error:
nested extern declaration of ‘g_spawn_async_with_fds’
[-Werror=nested-externs]
cc1: all warnings being treated as errors
/home/petmay01/linaro/qemu-for-merges/rules.mak:69: recipe for target
'slirp/misc.o' failed

Note that g_spawn_async_with_fds() is one of the glib routines
which we have a version of in glib-compat.h to cope with older
glib versions -- have you removed the #include of that and
not provided the equivalent code for slirp?


On OpenBSD there are lots of compiler errors, eg:

In file included from slirp/slirp.h:51:0,
                 from slirp/arp_table.c:25:
slirp/ip6.h: In function 'in6_equal':
slirp/ip6.h:37:5: warning: implicit declaration of function 'memcmp'
[-Wimplicit-function-declaration]
     return memcmp(a, b, sizeof(*a)) == 0;
     ^
slirp/ip6.h: In function 'in6_compute_ethaddr':
slirp/ip6.h:102:5: warning: implicit declaration of function 'memcpy'
[-Wimplicit-function-declaration]
     memcpy(&eth[2], &ip.s6_addr[16 - (ETH_ALEN - 2)], ETH_ALEN - 2);
     ^
slirp/ip6.h:102:5: warning: incompatible implicit declaration of
built-in function 'memcpy'
slirp/arp_table.c: In function 'arp_table_add':
slirp/arp_table.c:49:13: warning: incompatible implicit declaration of
built-in function 'memcpy'
             memcpy(arptbl->table[i].ar_sha, ethaddr, ETH_ALEN);
             ^
slirp/arp_table.c:56:5: warning: incompatible implicit declaration of
built-in function 'memcpy'
     memcpy(arptbl->table[arptbl->next_victim].ar_sha,  ethaddr, ETH_ALEN);
     ^
slirp/arp_table.c: In function 'arp_table_search':
slirp/arp_table.c:74:9: warning: implicit declaration of function
'memset' [-Wimplicit-function-declaration]
         memset(out_ethaddr, 0xff, ETH_ALEN);
         ^
slirp/arp_table.c:74:9: warning: incompatible implicit declaration of
built-in function 'memset'
slirp/arp_table.c:80:13: warning: incompatible implicit declaration of
built-in function 'memcpy'
             memcpy(out_ethaddr, arptbl->table[i].ar_sha,  ETH_ALEN);
             ^

In most of QEMU memcpy and friends are provided via
osdep.h -- if you don't want to include that you need
to replicate chunks of its functionality.

Linux s390 host fails similarly (memcpy, memcmp, strlen, etc all
not declared).

thanks
-- PMM
Samuel Thibault Jan. 28, 2019, 7:36 p.m. UTC | #2
Peter Maydell, le lun. 28 janv. 2019 15:44:21 +0000, a ecrit:
> Note that g_spawn_async_with_fds() is one of the glib routines
> which we have a version of in glib-compat.h to cope with older
> glib versions -- have you removed the #include of that and
> not provided the equivalent code for slirp?

It seems to be so. Slirp is the only user of this, perhaps I should just
move it there?

> On OpenBSD there are lots of compiler errors, eg:
> 
> In file included from slirp/slirp.h:51:0,
>                  from slirp/arp_table.c:25:
> slirp/ip6.h: In function 'in6_equal':
> slirp/ip6.h:37:5: warning: implicit declaration of function 'memcmp'

Ok, I have folded including string.h inclusion in the corresponding
patch.

Samuel
no-reply@patchew.org Jan. 31, 2019, 5:50 p.m. UTC | #3
Patchew URL: https://patchew.org/QEMU/20190127120526.15457-1-samuel.thibault@ens-lyon.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PULL 00/31] More work towards libslirp
Type: series
Message-id: 20190127120526.15457-1-samuel.thibault@ens-lyon.org

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
086f7d7b7f slirp: API is extern C
c2e1d6b240 slirp: pass opaque to all callbacks
c19ddaf64c slirp: use polling callbacks, drop glib requirement
600e978a5a slirp: remove slirp_instances list
8e90f99d6f slirp: replace global polling with per-instance & notifier
09989614bc slirp: improve send_packet() callback
7e06803d84 slirp: prefer c99 types over BSD kind
2106ceb26f slirp: replace remaining qemu headers dependency
e180feaaad slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT
67e47532ac slirp: replace qemu qtailq with slirp own copy
758839fdf4 slirp: replace net/eth.h inclusion with own defines
1366eee419 slirp: remove now useless QEMU headers inclusions
ecec547db1 slirp: remove qemu timer.h dependency
82b2be7991 slirp: add slirp own version of pstrcpy
b159c18370 slirp: improve windows headers inclusion
a6e6f6fa30 slirp: do not include qemu headers in libslirp.h public API header
2815fed03b slirp: move QEMU state saving to a separate unit
873df2da65 slirp: replace qemu_notify_event() with a callback
61450b485c slirp: add unregister_poll_fd() callback
6d55299f9a slirp: replace qemu_set_nonblock()
329b429a02 slirp: replace most qemu socket utilities with slirp own version
5bb1bbe6c6 slirp: replace QEMU_PACKED with SLIRP_PACKED
b63b7b009c slirp: replace trace functions with DEBUG calls
74b1324a77 slirp: add callbacks for timer
c64e3bd7c5 net/slirp: fix leaks on forwarding rule registration error
64ba1ea7bd net/slirp: free forwarding rules on cleanup
b90419a2b9 net/slirp: simplify checking for cmd: prefix
6eb5211cd0 slirp: generalize guestfwd with a callback based approach
2b07f25357 slirp: Don't mark struct ipq or struct ipasfrag as packed
03bd897f8b slirp: Avoid marking naturally packed structs as QEMU_PACKED
599fe3b577 slirp: Avoid unaligned 16bit memory access

=== OUTPUT BEGIN ===
1/31 Checking commit 599fe3b577fd (slirp: Avoid unaligned 16bit memory access)
2/31 Checking commit 03bd897f8b3d (slirp: Avoid marking naturally packed structs as QEMU_PACKED)
3/31 Checking commit 2b07f2535762 (slirp: Don't mark struct ipq or struct ipasfrag as packed)
4/31 Checking commit 6eb5211cd058 (slirp: generalize guestfwd with a callback based approach)
ERROR: code indent should never use tabs
#148: FILE: slirp/misc.h:14:
+^ISlirpWriteCb write_cb;$

ERROR: code indent should never use tabs
#149: FILE: slirp/misc.h:15:
+^Ivoid *opaque;$

total: 2 errors, 0 warnings, 226 lines checked

Patch 4/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

5/31 Checking commit b90419a2b9c4 (net/slirp: simplify checking for cmd: prefix)
6/31 Checking commit 64ba1ea7bd56 (net/slirp: free forwarding rules on cleanup)
7/31 Checking commit c64e3bd7c5a6 (net/slirp: fix leaks on forwarding rule registration error)
8/31 Checking commit 74b1324a771d (slirp: add callbacks for timer)
9/31 Checking commit b63b7b009c82 (slirp: replace trace functions with DEBUG calls)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#100: 
deleted file mode 100644

total: 0 errors, 1 warnings, 62 lines checked

Patch 9/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/31 Checking commit 5bb1bbe6c63a (slirp: replace QEMU_PACKED with SLIRP_PACKED)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#111: 
new file mode 100644

total: 0 errors, 1 warnings, 111 lines checked

Patch 10/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/31 Checking commit 329b429a021a (slirp: replace most qemu socket utilities with slirp own version)
ERROR: code indent should never use tabs
#130: FILE: slirp/socket.c:190:
+^Inn = slirp_recv(so->s, iov[0].iov_base, iov[0].iov_len,0);$

ERROR: space required after that ',' (ctx:VxV)
#130: FILE: slirp/socket.c:190:
+       nn = slirp_recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
                                                              ^

WARNING: line over 80 characters
#139: FILE: slirp/socket.c:206:
+                                       slirp_getsockopt(so->s, SOL_SOCKET, SO_ERROR,

ERROR: code indent should never use tabs
#139: FILE: slirp/socket.c:206:
+^I^I^I^I^Islirp_getsockopt(so->s, SOL_SOCKET, SO_ERROR,$

ERROR: space required after that ',' (ctx:VxV)
#148: FILE: slirp/socket.c:236:
+            ret = slirp_recv(so->s, iov[1].iov_base, iov[1].iov_len,0);
                                                                    ^

ERROR: code indent should never use tabs
#157: FILE: slirp/socket.c:557:
+^I  slirp_ioctlsocket(so->s, FIONREAD, &n);$

ERROR: code indent should never use tabs
#167: FILE: slirp/socket.c:722:
+^Iif (((s = slirp_socket(AF_INET,SOCK_STREAM,0)) < 0) ||$

ERROR: space required after that ',' (ctx:VxV)
#167: FILE: slirp/socket.c:722:
+       if (((s = slirp_socket(AF_INET,SOCK_STREAM,0)) < 0) ||
                                      ^

ERROR: space required after that ',' (ctx:VxV)
#167: FILE: slirp/socket.c:722:
+       if (((s = slirp_socket(AF_INET,SOCK_STREAM,0)) < 0) ||
                                                  ^

ERROR: do not use assignment in if condition
#167: FILE: slirp/socket.c:722:
+       if (((s = slirp_socket(AF_INET,SOCK_STREAM,0)) < 0) ||

ERROR: code indent should never use tabs
#168: FILE: slirp/socket.c:723:
+^I    (slirp_socket_set_fast_reuse(s) < 0) ||$

ERROR: code indent should never use tabs
#184: FILE: slirp/socket.c:740:
+^Islirp_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));$

ERROR: code indent should never use tabs
#187: FILE: slirp/socket.c:742:
+^Islirp_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(int));$

ERROR: code indent should never use tabs
#200: FILE: slirp/tcp_subr.c:340:
+^Islirp_closesocket(so->s);$

ERROR: code indent should never use tabs
#267: FILE: slirp/udp.c:295:
+^Islirp_closesocket(so->s);$

ERROR: code indent should never use tabs
#276: FILE: slirp/udp.c:330:
+^Iso->s = slirp_socket(AF_INET,SOCK_DGRAM,0);$

ERROR: space required after that ',' (ctx:VxV)
#276: FILE: slirp/udp.c:330:
+       so->s = slirp_socket(AF_INET,SOCK_DGRAM,0);
                                    ^

ERROR: space required after that ',' (ctx:VxV)
#276: FILE: slirp/udp.c:330:
+       so->s = slirp_socket(AF_INET,SOCK_DGRAM,0);
                                               ^

ERROR: code indent should never use tabs
#285: FILE: slirp/udp.c:346:
+^Islirp_socket_set_fast_reuse(so->s);$

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#290: 
new file mode 100644

ERROR: return of an errno should typically be -ve (return -EINTR)
#379: FILE: slirp/util.c:85:
+        return EINTR;

ERROR: return of an errno should typically be -ve (return -EINVAL)
#381: FILE: slirp/util.c:87:
+        return EINVAL;

ERROR: return of an errno should typically be -ve (return -EBADF)
#383: FILE: slirp/util.c:89:
+        return EBADF;

ERROR: return of an errno should typically be -ve (return -ENOMEM)
#385: FILE: slirp/util.c:91:
+        return ENOMEM;

ERROR: return of an errno should typically be -ve (return -EINVAL)
#387: FILE: slirp/util.c:93:
+        return EINVAL;

ERROR: return of an errno should typically be -ve (return -ENAMETOOLONG)
#389: FILE: slirp/util.c:95:
+        return ENAMETOOLONG;

ERROR: return of an errno should typically be -ve (return -ENOTEMPTY)
#391: FILE: slirp/util.c:97:
+        return ENOTEMPTY;

WARNING: Block comments use a leading /* on a separate line
#393: FILE: slirp/util.c:99:
+         /* not using EWOULDBLOCK as we don't want code to have

WARNING: Block comments use a trailing */ on a separate line
#394: FILE: slirp/util.c:100:
+          * to check both EWOULDBLOCK and EAGAIN */

ERROR: return of an errno should typically be -ve (return -EAGAIN)
#395: FILE: slirp/util.c:101:
+        return EAGAIN;

ERROR: return of an errno should typically be -ve (return -EINPROGRESS)
#397: FILE: slirp/util.c:103:
+        return EINPROGRESS;

ERROR: return of an errno should typically be -ve (return -EALREADY)
#399: FILE: slirp/util.c:105:
+        return EALREADY;

ERROR: return of an errno should typically be -ve (return -ENOTSOCK)
#401: FILE: slirp/util.c:107:
+        return ENOTSOCK;

ERROR: return of an errno should typically be -ve (return -EDESTADDRREQ)
#403: FILE: slirp/util.c:109:
+        return EDESTADDRREQ;

ERROR: return of an errno should typically be -ve (return -EMSGSIZE)
#405: FILE: slirp/util.c:111:
+        return EMSGSIZE;

ERROR: return of an errno should typically be -ve (return -EPROTOTYPE)
#407: FILE: slirp/util.c:113:
+        return EPROTOTYPE;

ERROR: return of an errno should typically be -ve (return -ENOPROTOOPT)
#409: FILE: slirp/util.c:115:
+        return ENOPROTOOPT;

ERROR: return of an errno should typically be -ve (return -EPROTONOSUPPORT)
#411: FILE: slirp/util.c:117:
+        return EPROTONOSUPPORT;

ERROR: return of an errno should typically be -ve (return -EOPNOTSUPP)
#413: FILE: slirp/util.c:119:
+        return EOPNOTSUPP;

ERROR: return of an errno should typically be -ve (return -EAFNOSUPPORT)
#415: FILE: slirp/util.c:121:
+        return EAFNOSUPPORT;

ERROR: return of an errno should typically be -ve (return -EADDRINUSE)
#417: FILE: slirp/util.c:123:
+        return EADDRINUSE;

ERROR: return of an errno should typically be -ve (return -EADDRNOTAVAIL)
#419: FILE: slirp/util.c:125:
+        return EADDRNOTAVAIL;

ERROR: return of an errno should typically be -ve (return -ENETDOWN)
#421: FILE: slirp/util.c:127:
+        return ENETDOWN;

ERROR: return of an errno should typically be -ve (return -ENETUNREACH)
#423: FILE: slirp/util.c:129:
+        return ENETUNREACH;

ERROR: return of an errno should typically be -ve (return -ENETRESET)
#425: FILE: slirp/util.c:131:
+        return ENETRESET;

ERROR: return of an errno should typically be -ve (return -ECONNABORTED)
#427: FILE: slirp/util.c:133:
+        return ECONNABORTED;

ERROR: return of an errno should typically be -ve (return -ECONNRESET)
#429: FILE: slirp/util.c:135:
+        return ECONNRESET;

ERROR: return of an errno should typically be -ve (return -ENOBUFS)
#431: FILE: slirp/util.c:137:
+        return ENOBUFS;

ERROR: return of an errno should typically be -ve (return -EISCONN)
#433: FILE: slirp/util.c:139:
+        return EISCONN;

ERROR: return of an errno should typically be -ve (return -ENOTCONN)
#435: FILE: slirp/util.c:141:
+        return ENOTCONN;

ERROR: return of an errno should typically be -ve (return -ETIMEDOUT)
#437: FILE: slirp/util.c:143:
+        return ETIMEDOUT;

ERROR: return of an errno should typically be -ve (return -ECONNREFUSED)
#439: FILE: slirp/util.c:145:
+        return ECONNREFUSED;

ERROR: return of an errno should typically be -ve (return -ELOOP)
#441: FILE: slirp/util.c:147:
+        return ELOOP;

ERROR: return of an errno should typically be -ve (return -EHOSTUNREACH)
#443: FILE: slirp/util.c:149:
+        return EHOSTUNREACH;

ERROR: return of an errno should typically be -ve (return -EIO)
#445: FILE: slirp/util.c:151:
+        return EIO;

WARNING: line over 80 characters
#514: FILE: slirp/util.h:61:
+#define slirp_recv(sockfd, buf, len, flags) recv(sockfd, (void *)buf, len, flags)

WARNING: Block comments use a leading /* on a separate line
#537: FILE: slirp/util.h:84:
+    /* Enabling the reuse of an endpoint that was used by a socket still in

WARNING: Block comments use a trailing */ on a separate line
#541: FILE: slirp/util.h:88:
+     * http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx */

total: 51 errors, 7 warnings, 477 lines checked

Patch 11/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

12/31 Checking commit 6d55299f9a88 (slirp: replace qemu_set_nonblock())
13/31 Checking commit 61450b485ca4 (slirp: add unregister_poll_fd() callback)
ERROR: code indent should never use tabs
#87: FILE: slirp/tcp_subr.c:340:
+^Iso->slirp->cb->unregister_poll_fd(so->s);$

ERROR: code indent should never use tabs
#107: FILE: slirp/udp.c:295:
+^Iso->slirp->cb->unregister_poll_fd(so->s);$

total: 2 errors, 0 warnings, 63 lines checked

Patch 13/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

14/31 Checking commit 873df2da6525 (slirp: replace qemu_notify_event() with a callback)
ERROR: code indent should never use tabs
#115: FILE: slirp/tcp_input.c:509:
+^I^I^I^Isodrop(so, acked);$

ERROR: code indent should never use tabs
#124: FILE: slirp/tcp_input.c:1121:
+^I^I^Isodrop(so, (int)so->so_snd.sb_cc);$

ERROR: code indent should never use tabs
#128: FILE: slirp/tcp_input.c:1124:
+^I^I^Isodrop(so, acked);$

total: 3 errors, 0 warnings, 79 lines checked

Patch 14/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

15/31 Checking commit 2815fed03b99 (slirp: move QEMU state saving to a separate unit)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#455: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#547: FILE: slirp/state.c:88:
+/* The sbuf has a pair of pointers that are migrated as offsets;

WARNING: Block comments use a leading /* on a separate line
#645: FILE: slirp/state.c:186:
+/* The OS provided ss_family field isn't that portable; it's size

ERROR: if this code is redundant consider removing it
#715: FILE: slirp/state.c:256:
+#if 0

total: 1 errors, 3 warnings, 475 lines checked

Patch 15/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/31 Checking commit a6e6f6fa30d8 (slirp: do not include qemu headers in libslirp.h public API header)
17/31 Checking commit b159c1837017 (slirp: improve windows headers inclusion)
18/31 Checking commit 82b2be799183 (slirp: add slirp own version of pstrcpy)
WARNING: line over 80 characters
#37: FILE: slirp/tftp.c:219:
+  slirp_pstrcpy((char *)tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg);

ERROR: braces {} are necessary for all arms of this statement
#55: FILE: slirp/util.c:197:
+    if (buf_size <= 0)
[...]

ERROR: space required before the open parenthesis '('
#58: FILE: slirp/util.c:200:
+    for(;;) {

ERROR: braces {} are necessary for all arms of this statement
#60: FILE: slirp/util.c:202:
+        if (c == 0 || q >= buf + buf_size - 1)
[...]

total: 3 errors, 1 warnings, 44 lines checked

Patch 18/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

19/31 Checking commit ecec547db1db (slirp: remove qemu timer.h dependency)
20/31 Checking commit 1366eee4196b (slirp: remove now useless QEMU headers inclusions)
21/31 Checking commit 758839fdf4b6 (slirp: replace net/eth.h inclusion with own defines)
22/31 Checking commit 67e47532acad (slirp: replace qemu qtailq with slirp own copy)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#12: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#76: FILE: slirp/qtailq.h:60:
+        struct type *tqh_first;       /* first element */               \

WARNING: Block comments use a leading /* on a separate line
#77: FILE: slirp/qtailq.h:61:
+        QTailQLink tqh_circ;          /* link for circular backwards list */ \

WARNING: Block comments use a leading /* on a separate line
#85: FILE: slirp/qtailq.h:69:
+        struct type *tqe_next;        /* next element */                \

WARNING: Block comments use a leading /* on a separate line
#86: FILE: slirp/qtailq.h:70:
+        QTailQLink tqe_circ;          /* link for circular backwards list */ \

WARNING: Block comments use a leading /* on a separate line
#92: FILE: slirp/qtailq.h:76:
+} while (/*CONSTCOND*/0)

ERROR: do not use assignment in if condition
#95: FILE: slirp/qtailq.h:79:
+        if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \

WARNING: Block comments use a leading /* on a separate line
#102: FILE: slirp/qtailq.h:86:
+} while (/*CONSTCOND*/0)

WARNING: Block comments use a leading /* on a separate line
#109: FILE: slirp/qtailq.h:93:
+} while (/*CONSTCOND*/0)

ERROR: do not use assignment in if condition
#112: FILE: slirp/qtailq.h:96:
+        if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\

WARNING: Block comments use a leading /* on a separate line
#119: FILE: slirp/qtailq.h:103:
+} while (/*CONSTCOND*/0)

WARNING: Block comments use a leading /* on a separate line
#126: FILE: slirp/qtailq.h:110:
+} while (/*CONSTCOND*/0)

WARNING: Block comments use a leading /* on a separate line
#136: FILE: slirp/qtailq.h:120:
+} while (/*CONSTCOND*/0)

WARNING: line over 80 characters
#164: FILE: slirp/qtailq.h:148:
+#define QTAILQ_IN_USE(elm, field)        ((elm)->field.tqe_circ.tql_prev != NULL)

WARNING: line over 80 characters
#171: FILE: slirp/qtailq.h:155:
+        ((typeof((elm)->field.tqe_next)) QTAILQ_LINK_PREV((elm)->field.tqe_circ))

WARNING: line over 80 characters
#202: FILE: slirp/qtailq.h:186:
+#define QTAILQ_RAW_INSERT_TAIL(head, elm, entry) do {                           \

WARNING: line over 80 characters
#203: FILE: slirp/qtailq.h:187:
+        *QTAILQ_RAW_NEXT(elm, entry) = NULL;                                    \

WARNING: line over 80 characters
#204: FILE: slirp/qtailq.h:188:
+        QTAILQ_RAW_TQE_CIRC(elm, entry)->tql_prev = QTAILQ_RAW_TQH_CIRC(head)->tql_prev; \

WARNING: line over 80 characters
#205: FILE: slirp/qtailq.h:189:
+        QTAILQ_RAW_TQH_CIRC(head)->tql_prev->tql_next = (elm);                  \

WARNING: line over 80 characters
#206: FILE: slirp/qtailq.h:190:
+        QTAILQ_RAW_TQH_CIRC(head)->tql_prev = QTAILQ_RAW_TQE_CIRC(elm, entry);  \

WARNING: Block comments use a leading /* on a separate line
#207: FILE: slirp/qtailq.h:191:
+} while (/*CONSTCOND*/0)

total: 2 errors, 19 warnings, 202 lines checked

Patch 22/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

23/31 Checking commit e180feaaad16 (slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT)
24/31 Checking commit 2106ceb26f7b (slirp: replace remaining qemu headers dependency)
25/31 Checking commit 7e06803d841b (slirp: prefer c99 types over BSD kind)
ERROR: code indent should never use tabs
#60: FILE: slirp/ip_icmp.h:47:
+^Iuint8_t^Iicmp_type;^I^I/* type of message, see below */$

ERROR: code indent should never use tabs
#61: FILE: slirp/ip_icmp.h:48:
+^Iuint8_t^Iicmp_code;^I^I/* type sub code */$

WARNING: line over 80 characters
#62: FILE: slirp/ip_icmp.h:49:
+       uint16_t        icmp_cksum;             /* ones complement cksum of struct */

ERROR: code indent should never use tabs
#62: FILE: slirp/ip_icmp.h:49:
+^Iuint16_t^Iicmp_cksum;^I^I/* ones complement cksum of struct */$

ERROR: code indent should never use tabs
#65: FILE: slirp/ip_icmp.h:51:
+^I^Iuint8_t ih_pptr;^I^I^I/* ICMP_PARAMPROB */$

ERROR: code indent should never use tabs
#70: FILE: slirp/ip_icmp.h:54:
+^I^I^Iuint16_t^Iicd_id;$

ERROR: code indent should never use tabs
#71: FILE: slirp/ip_icmp.h:55:
+^I^I^Iuint16_t^Iicd_seq;$

ERROR: code indent should never use tabs
#79: FILE: slirp/ip_icmp.h:61:
+^I^I^Iuint16_t ipm_void;$

ERROR: code indent should never use tabs
#80: FILE: slirp/ip_icmp.h:62:
+^I^I^Iuint16_t ipm_nextmtu;$

ERROR: code indent should never use tabs
#102: FILE: slirp/ip_input.c:461:
+^Iregister char *opts;$

ERROR: code indent should never use tabs
#107: FILE: slirp/ip_input.c:465:
+^Iopts = (char *)(ip + 1);$

ERROR: code indent should never use tabs
#133: FILE: slirp/mbuf.h:88:
+^Ichar *m_data;^I^I^I/* Current location of data */$

ERROR: space prohibited before that close parenthesis ')'
#167: FILE: slirp/slirp.c:95:
+        printf("GetNetworkParams failed. ret = %08x\n", (unsigned)ret );

ERROR: code indent should never use tabs
#231: FILE: slirp/socket.c:509:
+^I    uint8_t code=ICMP_UNREACH_PORT;$

ERROR: spaces required around that '=' (ctx:VxV)
#231: FILE: slirp/socket.c:509:
+           uint8_t code=ICMP_UNREACH_PORT;
                        ^

ERROR: code indent should never use tabs
#255: FILE: slirp/socket.h:64:
+  unsigned^Iso_expire;^I^I/* When the socket will expire */$

ERROR: "foo * bar" should be "foo *bar"
#264: FILE: slirp/socket.h:147:
+struct socket * tcp_listen(Slirp *, uint32_t, unsigned, uint32_t, unsigned,

ERROR: code indent should never use tabs
#286: FILE: slirp/tcp_input.c:200:
+^Ichar *optp = NULL;$

ERROR: code indent should never use tabs
#295: FILE: slirp/tcp_input.c:208:
+^Iuint32_t tiwin;$

ERROR: code indent should never use tabs
#304: FILE: slirp/tcp_input.c:330:
+^I  optp = mtod(m, char *) + sizeof (struct tcpiphdr);$

ERROR: space prohibited between function name and open parenthesis '('
#304: FILE: slirp/tcp_input.c:330:
+         optp = mtod(m, char *) + sizeof (struct tcpiphdr);

ERROR: code indent should never use tabs
#313: FILE: slirp/tcp_input.c:472:
+^I^Itcp_dooptions(tp, (uint8_t *)optp, optlen, ti);$

ERROR: code indent should never use tabs
#322: FILE: slirp/tcp_input.c:727:
+^I    tcp_dooptions(tp, (uint8_t *)optp, optlen, ti);$

ERROR: code indent should never use tabs
#331: FILE: slirp/tcp_input.c:1042:
+^I^I^I^I^Iunsigned win =$

ERROR: code indent should never use tabs
#341: FILE: slirp/tcp_input.c:1111:
+^I^I  register unsigned cw = tp->snd_cwnd;$

ERROR: code indent should never use tabs
#342: FILE: slirp/tcp_input.c:1112:
+^I^I  register unsigned incr = tp->t_maxseg;$

ERROR: code indent should never use tabs
#382: FILE: slirp/tcp_output.c:66:
+^Iuint8_t opt[MAX_TCPOPTLEN];$

ERROR: code indent should never use tabs
#391: FILE: slirp/tcp_output.c:274:
+^I^I^Imemcpy((char *)(opt + 2), (char *)&mss, sizeof(mss));$

ERROR: code indent should never use tabs
#400: FILE: slirp/tcp_output.c:304:
+^I^Isbcopy(&so->so_snd, off, (int) len, mtod(m, char *) + hdrlen);$

ERROR: code indent should never use tabs
#409: FILE: slirp/tcp_output.c:327:
+^Imemcpy((char *)ti, &tp->t_template, sizeof (struct tcpiphdr));$

ERROR: space prohibited between function name and open parenthesis '('
#409: FILE: slirp/tcp_output.c:327:
+       memcpy((char *)ti, &tp->t_template, sizeof (struct tcpiphdr));

ERROR: code indent should never use tabs
#418: FILE: slirp/tcp_output.c:356:
+^I^Imemcpy((char *)(ti + 1), (char *)opt, optlen);$

ERROR: code indent should never use tabs
#431: FILE: slirp/tcp_subr.c:166:
+^I^Im->m_data = (char *)ti;$

ERROR: code indent should never use tabs
#440: FILE: slirp/tcp_subr.c:185:
+^Iti->ti_len = htons((uint16_t)(sizeof (struct tcphdr) + tlen));$

ERROR: space prohibited between function name and open parenthesis '('
#440: FILE: slirp/tcp_subr.c:185:
+       ti->ti_len = htons((uint16_t)(sizeof (struct tcphdr) + tlen));

ERROR: code indent should never use tabs
#449: FILE: slirp/tcp_subr.c:616:
+^Iunsigned n1, n2, n3, n4, n5, n6;$

ERROR: code indent should never use tabs
#453: FILE: slirp/tcp_subr.c:619:
+^Iunsigned lport;$

ERROR: code indent should never use tabs
#462: FILE: slirp/tcp_subr.c:856:
+^I^I^Iuint16_t p;$

ERROR: code indent should never use tabs
#472: FILE: slirp/tcp_subr.c:912:
+^I^I^I^Ilport = (((uint8_t*)bptr)[0] << 8)$

ERROR: "(foo*)" should be "(foo *)"
#472: FILE: slirp/tcp_subr.c:912:
+                               lport = (((uint8_t*)bptr)[0] << 8)

ERROR: code indent should never use tabs
#473: FILE: slirp/tcp_subr.c:913:
+^I^I^I^I+ ((uint8_t *)bptr)[1];$

ERROR: code indent should never use tabs
#483: FILE: slirp/tcp_subr.c:931:
+^I^I^I^I*(uint8_t *)bptr++ = (p >> 8) & 0xff;$

WARNING: line over 80 characters
#497: FILE: slirp/tcp_timer.c:235:
+                unsigned win = MIN(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;

ERROR: code indent should never use tabs
#510: FILE: slirp/tcp_var.h:50:
+^Iuint16_t^It_maxseg;^I^I/* maximum segment size */$

ERROR: code indent should never use tabs
#513: FILE: slirp/tcp_var.h:52:
+^Iuint16_t^It_flags;$

ERROR: code indent should never use tabs
#522: FILE: slirp/tcp_var.h:108:
+^Iuint16_t^It_rttmin;^I^I/* minimum rtt allowed */$

ERROR: code indent should never use tabs
#534: FILE: slirp/tcp_var.h:119:
+^Iuint8_t^Isnd_scale;^I^I/* window scaling for send window */$

ERROR: code indent should never use tabs
#535: FILE: slirp/tcp_var.h:120:
+^Iuint8_t^Ircv_scale;^I^I/* window scaling for recv window */$

ERROR: code indent should never use tabs
#536: FILE: slirp/tcp_var.h:121:
+^Iuint8_t^Irequest_r_scale;^I/* pending window scaling */$

ERROR: code indent should never use tabs
#537: FILE: slirp/tcp_var.h:122:
+^Iuint8_t^Irequested_s_scale;$

ERROR: code indent should never use tabs
#550: FILE: slirp/udp.c:95:
+^Iuh = (struct udphdr *)((char *)ip + iphlen);$

ERROR: "foo * bar" should be "foo *bar"
#574: FILE: slirp/udp.h:81:
+struct socket * udp_listen(Slirp *, uint32_t, unsigned, uint32_t, unsigned,

ERROR: externs should be avoided in .c files
#587: FILE: util/osdep.c:32:
+extern int madvise(char *, size_t, int);

total: 51 errors, 2 warnings, 455 lines checked

Patch 25/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

26/31 Checking commit 09989614bca1 (slirp: improve send_packet() callback)
27/31 Checking commit 8e90f99d6f6c (slirp: replace global polling with per-instance & notifier)
ERROR: spaces required around that '/' (ctx:VxV)
#237: FILE: slirp/slirp.c:471:
+            (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2))) {
                                                       ^

WARNING: Block comments use a leading /* on a separate line
#565: FILE: slirp/slirp.c:611:
+                    /* Socket error might have resulted in the socket being

WARNING: Block comments use a trailing */ on a separate line
#566: FILE: slirp/slirp.c:612:
+                     * removed, do not try to do anything more with it. */

WARNING: Block comments use a leading /* on a separate line
#594: FILE: slirp/slirp.c:634:
+                    /* Socket error might have resulted in the socket being

WARNING: Block comments use a trailing */ on a separate line
#595: FILE: slirp/slirp.c:635:
+                     * removed, do not try to do anything more with it. */

WARNING: Block comments use a leading /* on a separate line
#653: FILE: slirp/slirp.c:675:
+                        /* Call tcp_output in case we need to send a window

WARNING: Block comments use a trailing */ on a separate line
#655: FILE: slirp/slirp.c:677:
+                         * until it sends a window probe. */

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#817: 
deleted file mode 100644

total: 1 errors, 7 warnings, 829 lines checked

Patch 27/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

28/31 Checking commit 600e978a5a41 (slirp: remove slirp_instances list)
29/31 Checking commit c19ddaf64c2e (slirp: use polling callbacks, drop glib requirement)
30/31 Checking commit c2e1d6b240cd (slirp: pass opaque to all callbacks)
WARNING: line over 80 characters
#95: FILE: slirp/dhcpv6.c:62:
+            slirp->cb->guest_error("Guest sent bad DHCPv6 packet!", slirp->opaque);

WARNING: line over 80 characters
#131: FILE: slirp/ip6_icmp.c:28:
+    slirp->ra_timer = slirp->cb->timer_new(ra_timer_handler, slirp, slirp->opaque);

WARNING: line over 80 characters
#276: FILE: slirp/slirp.c:888:
+            ifm->expiration_date = slirp->cb->clock_get_ns(slirp->opaque) + 1000000000ULL;

ERROR: code indent should never use tabs
#310: FILE: slirp/tcp_subr.c:339:
+^Iso->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque);$

ERROR: code indent should never use tabs
#350: FILE: slirp/udp.c:294:
+^Iso->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque);$

total: 2 errors, 3 warnings, 273 lines checked

Patch 30/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

31/31 Checking commit 086f7d7b7fd4 (slirp: API is extern C)
WARNING: architecture specific defines should be avoided
#21: FILE: slirp/libslirp.h:15:
+#ifdef __cplusplus

WARNING: architecture specific defines should be avoided
#33: FILE: slirp/libslirp.h:103:
+#ifdef __cplusplus

total: 0 errors, 2 warnings, 19 lines checked

Patch 31/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190127120526.15457-1-samuel.thibault@ens-lyon.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com