diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2014-01-23 08:32:41 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-28 00:52:35 +0000 |
commit | 162dd389301ce238b5003d6b4f6031256532508b (patch) | |
tree | 8100bf96362321edec26f099334102d3962c5bdd /meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch | |
parent | b3bb9c770b17be4f7e1e424e0d0ec00ebe5bfb62 (diff) | |
download | poky-162dd389301ce238b5003d6b4f6031256532508b.tar.gz |
unfs3: Add a NFSv3 user mode server for use with runqemu
The user mode nfs server allows the use of runqemu without any root
privileges and may even be accelerated with kvm.
Example:
runqemu-extract-sdk tmp-eglibc/deploy/images/qemux86-64/core-image-minimal-qemux86-64.tar.bz2 rootfs
runqemu qemux86-64 `pwd`/rootfs nographic slirp kvm
[YOCTO #5639]
(From OE-Core rev: 24183f5ec9c71db936e75060387941463d30d962)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch')
-rw-r--r-- | meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch b/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch new file mode 100644 index 0000000000..bc78dee361 --- /dev/null +++ b/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | daemon.c: Add option for tcp no delay | ||
2 | |||
3 | Allow the NFS tcp sockets to conditionally use TCP_NODELAY | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | --- | ||
8 | daemon.c | 9 ++++++++- | ||
9 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
10 | |||
11 | --- a/daemon.c | ||
12 | +++ b/daemon.c | ||
13 | @@ -17,6 +17,7 @@ | ||
14 | #ifndef WIN32 | ||
15 | #include <sys/socket.h> | ||
16 | #include <netinet/in.h> | ||
17 | +#include <netinet/tcp.h> | ||
18 | #include <arpa/inet.h> | ||
19 | #include <syslog.h> | ||
20 | #else /* WIN32 */ | ||
21 | @@ -75,6 +76,7 @@ unsigned int opt_mount_port = NFS_PORT; | ||
22 | int opt_singleuser = FALSE; | ||
23 | int opt_brute_force = FALSE; | ||
24 | int opt_testconfig = FALSE; | ||
25 | +int opt_tcp_nodelay = FALSE; | ||
26 | struct in_addr opt_bind_addr; | ||
27 | int opt_readable_executables = FALSE; | ||
28 | char *opt_pid_file = NULL; | ||
29 | @@ -208,7 +210,7 @@ static void parse_options(int argc, char | ||
30 | { | ||
31 | |||
32 | int opt = 0; | ||
33 | - char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:"; | ||
34 | + char *optstring = "bcC:de:hl:m:Nn:prstTuwi:x:y:"; | ||
35 | |||
36 | while (opt != -1) { | ||
37 | opt = getopt(argc, argv, optstring); | ||
38 | @@ -295,6 +297,9 @@ static void parse_options(int argc, char | ||
39 | exit(1); | ||
40 | } | ||
41 | break; | ||
42 | + case 'N': | ||
43 | + opt_tcp_nodelay = TRUE; | ||
44 | + break; | ||
45 | case 'n': | ||
46 | opt_nfs_port = strtol(optarg, NULL, 10); | ||
47 | if (opt_nfs_port == 0) { | ||
48 | @@ -802,6 +807,8 @@ static SVCXPRT *create_tcp_transport(uns | ||
49 | sin.sin_addr.s_addr = opt_bind_addr.s_addr; | ||
50 | sock = socket(PF_INET, SOCK_STREAM, 0); | ||
51 | setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on)); | ||
52 | + if (opt_tcp_nodelay) | ||
53 | + setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); | ||
54 | if (bind(sock, (struct sockaddr *) &sin, sizeof(struct sockaddr))) { | ||
55 | perror("bind"); | ||
56 | fprintf(stderr, "Couldn't bind to tcp port %d\n", port); | ||