[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3] linux-user: improve target_to_host_sock_type
From: |
Petar Jovanovic |
Subject: |
Re: [Qemu-devel] [PATCH v3] linux-user: improve target_to_host_sock_type conversion |
Date: |
Tue, 2 Jul 2013 14:13:45 +0000 |
________________________________________
From: Peter Maydell address@hidden
Sent: Tuesday, July 02, 2013 3:44 PM
To: Petar Jovanovic
Cc: address@hidden; Petar Jovanovic; address@hidden; address@hidden;
address@hidden
Subject: Re: [PATCH v3] linux-user: improve target_to_host_sock_type conversion
On 1 July 2013 01:44, Petar Jovanovic <address@hidden> wrote:
> The patch also includes necessary code style changes (tab to spaces) in the
> header file since most of the file has been touched by this change.
Thanks for the review, Peter.
> (The general rule of thumb is "if you're just changing a few lines
> of indent/braces in lines that the patch touches anyway" that's fine;
> larger scale changes go in their own patch if we do them at all.)
I am aware of this, and I originally tried to make these changes as small
as possible. Check for the previous two versions of the patch.
The commit message originally said:
"The patch also includes necessary code style changes (tab to spaces) in the
header file in the MIPS #ifdef block touched by the change."
Yet, I ended up changing 80% of the header file with this version, so I
was under impression it makes sense to change the remaining 20%.
> Not using the same base as the kernel (hex vs octal) made checking
> the values a bit tedious too, but I think they're all correct.
What values are you refering to?
I actually tried to copy the values from the kernel in the same format:
O_NONBLOCK 00004000
http://lxr.free-electrons.com/source/include/uapi/asm-generic/fcntl.h#L37
O_CLOEXEC 02000000
http://lxr.free-electrons.com/source/include/uapi/asm-generic/fcntl.h#L61
all socket type values:
http://lxr.free-electrons.com/source/include/linux/net.h#L58
enum sock_type {
SOCK_STREAM = 1,
SOCK_DGRAM = 2,
SOCK_RAW = 3,
SOCK_RDM = 4,
SOCK_SEQPACKET = 5,
SOCK_DCCP = 6,
SOCK_PACKET = 10,
};
#define SOCK_TYPE_MASK 0xf
Petar