Re: [Qemu-devel] [PATCH v2 6/6] linux_user: consolidate sock_type

2017-10-17 Thread Carlo Arenas
On Wed, Oct 11, 2017 at 6:23 AM, Laurent Vivier  wrote:
> Le 26/09/2017 à 01:19, Carlo Marcelo Arenas Belón a écrit :
>> remove unnecessary sock_type enum and other unused surrounding code to
>> allow for per arch sockbits to mirror better linux headers for maintenance
>>
>> Signed-off-by: Carlo Marcelo Arenas Belón 
>> ---
>>  linux-user/alpha/sockbits.h | 36 
>>  linux-user/hppa/sockbits.h  | 30 ---
>>  linux-user/mips/sockbits.h  | 35 ---
>>  linux-user/socket.h | 58 
>> ++---
>>  linux-user/sparc/sockbits.h | 35 ---
>>  5 files changed, 29 insertions(+), 165 deletions(-)
>
> I think it's not a good idea to mix again what we have just unmixed.

do you object to the fact it was done in 2 steps (first moving out
from socket.h and then added it back as a single block)?  it was done
that way to reuse as much as possible the code that was already
reviewed.

the end result is the important part, though; and it is a sockbits.h
for those 4 architectures (and a socket.h for the rest) that could be
automatically generated or compared with the corresponding linux
headers and therefore hopefully be easier to maintain going forward.

since we are going to redo the series anyway, could we get some
discussion/agreement on the design of it?, have to admit I am a little
surprised by all the patches flying by the list but not many
conversations, and being new to qemu linux-user I think I could have
benefited from it to avoid some of the mistakes made.

Carlo



Re: [Qemu-devel] [PATCH v2 6/6] linux_user: consolidate sock_type

2017-10-11 Thread Laurent Vivier
Le 26/09/2017 à 01:19, Carlo Marcelo Arenas Belón a écrit :
> remove unnecessary sock_type enum and other unused surrounding code to
> allow for per arch sockbits to mirror better linux headers for maintenance
> 
> Signed-off-by: Carlo Marcelo Arenas Belón 
> ---
>  linux-user/alpha/sockbits.h | 36 
>  linux-user/hppa/sockbits.h  | 30 ---
>  linux-user/mips/sockbits.h  | 35 ---
>  linux-user/socket.h | 58 
> ++---
>  linux-user/sparc/sockbits.h | 35 ---
>  5 files changed, 29 insertions(+), 165 deletions(-)

I think it's not a good idea to mix again what we have just unmixed.

Thanks,
Laurent



[Qemu-devel] [PATCH v2 6/6] linux_user: consolidate sock_type

2017-09-25 Thread Carlo Marcelo Arenas Belón
remove unnecessary sock_type enum and other unused surrounding code to
allow for per arch sockbits to mirror better linux headers for maintenance

Signed-off-by: Carlo Marcelo Arenas Belón 
---
 linux-user/alpha/sockbits.h | 36 
 linux-user/hppa/sockbits.h  | 30 ---
 linux-user/mips/sockbits.h  | 35 ---
 linux-user/socket.h | 58 ++---
 linux-user/sparc/sockbits.h | 35 ---
 5 files changed, 29 insertions(+), 165 deletions(-)

diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h
index 768579a1f7..defdb806ea 100644
--- a/linux-user/alpha/sockbits.h
+++ b/linux-user/alpha/sockbits.h
@@ -66,39 +66,3 @@
 #define TARGET_SCM_TIMESTAMPING_PKTINFO 58
 #define TARGET_SO_PEERGROUPS59
 #define TARGET_SO_ZEROCOPY  60
-
-/** sock_type - Socket types
- *
- * Please notice that for binary compat reasons ALPHA has to
- * override the enum sock_type in include/linux/net.h, so
- * we define ARCH_HAS_SOCKET_TYPES here.
- *
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- *For writing rarp and other similar things on the user
- *level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-
-enum sock_type {
-TARGET_SOCK_STREAM  = 1,
-TARGET_SOCK_DGRAM   = 2,
-TARGET_SOCK_RAW = 3,
-TARGET_SOCK_RDM = 4,
-TARGET_SOCK_SEQPACKET   = 5,
-TARGET_SOCK_DCCP= 6,
-TARGET_SOCK_PACKET  = 10,
-TARGET_SOCK_CLOEXEC = 01000,
-TARGET_SOCK_NONBLOCK= 0x4000,
-};
-
-#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-#define TARGET_SOCK_TYPE_MASK 0xf  /* Covers up to TARGET_SOCK_MAX - 1. */
-
-#define ARCH_HAS_SOCKET_TYPES 1
diff --git a/linux-user/hppa/sockbits.h b/linux-user/hppa/sockbits.h
index 3dab31a76a..32f81357d6 100644
--- a/linux-user/hppa/sockbits.h
+++ b/linux-user/hppa/sockbits.h
@@ -71,33 +71,3 @@
 #define TARGET_SO_PEERGROUPS0x4034
 #define TARGET_SO_ZEROCOPY  0x4035
 
-/** sock_type - Socket types - default values
- *
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- *For writing rarp and other similar things on the user
- *level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-enum sock_type {
-TARGET_SOCK_STREAM= 1,
-TARGET_SOCK_DGRAM = 2,
-TARGET_SOCK_RAW   = 3,
-TARGET_SOCK_RDM   = 4,
-TARGET_SOCK_SEQPACKET = 5,
-TARGET_SOCK_DCCP  = 6,
-TARGET_SOCK_PACKET= 10,
-TARGET_SOCK_CLOEXEC   = 01000,
-TARGET_SOCK_NONBLOCK  = 0x4000,
-};
-
-#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-#define TARGET_SOCK_TYPE_MASK 0xf  /* Covers up to TARGET_SOCK_MAX - 1. */
-
-#define ARCH_HAS_SOCKET_TYPES 1
diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h
index 6d8ea8aba2..fa8062391d 100644
--- a/linux-user/mips/sockbits.h
+++ b/linux-user/mips/sockbits.h
@@ -70,38 +70,3 @@
 #define TARGET_SCM_TIMESTAMPING_PKTINFO 58
 #define TARGET_SO_PEERGROUPS59
 #define TARGET_SO_ZEROCOPY  60
-
-/** sock_type - Socket types
- *
- * Please notice that for binary compat reasons MIPS has to
- * override the enum sock_type in include/linux/net.h, so
- * we define ARCH_HAS_SOCKET_TYPES here.
- *
- * @SOCK_DGRAM - datagram (conn.less) socket
- * @SOCK_STREAM - stream (connection) socket
- * @SOCK_RAW - raw socket
- * @SOCK_RDM - reliably-delivered message
- * @SOCK_SEQPACKET - sequential packet socket
- * @SOCK_DCCP - Datagram Congestion Control Protocol socket
- * @SOCK_PACKET - linux specific way of getting packets at the dev level.
- *For writing rarp and other similar things on the user
- *level.
- * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
- * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
- */
-enum sock_type {
-TARGET_SOCK_DGRAM   = 1,
-TARGET_SOCK_STREAM  = 2,
-TARGET_SOCK_RAW = 3,
-TARGET_SOCK_RDM = 4,
-TARGET_SOCK_SEQPACKET   = 5,
-TARGET_SOCK_DCCP= 6,
-