From: chrubis@suse.cz
To: Shuang Qiu <shuang.qiu@oracle.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2] containers/netns:parameters are not correct when calling, crtchild() function
Date: Thu, 17 Apr 2014 14:50:04 +0200 [thread overview]
Message-ID: <20140417125003.GA949@rei> (raw)
In-Reply-To: <534FA1A9.10902@oracle.com>
Hi!
> The numbers of parameters for crtchild() function which called in
> two_children_ns.c and par_chld_ipv6.c is not correct.And it will make
> the child process to be a zombie process.
> And also move the definition of the function to the header file(common.h)
>
> Signed-off-by: shuang.qiu@oracle.com
> ---
> testcases/kernel/containers/libclone/libclone.h | 2 -
> testcases/kernel/containers/netns/common.c | 18 +-------
> testcases/kernel/containers/netns/common.h | 47
> ++++++++++++++++++++
> .../kernel/containers/netns/create_container.c | 2 +-
> testcases/kernel/containers/netns/crtchild.c | 2 +-
> .../kernel/containers/netns/crtchild_delchild.c | 2 +-
> testcases/kernel/containers/netns/par_chld_ftp.c | 2 +-
> testcases/kernel/containers/netns/par_chld_ipv6.c | 5 +--
> testcases/kernel/containers/netns/sysfsview.c | 2 +-
> .../kernel/containers/netns/two_children_ns.c | 5 +--
> 10 files changed, 57 insertions(+), 30 deletions(-)
> create mode 100644 testcases/kernel/containers/netns/common.h
>
> diff --git a/testcases/kernel/containers/libclone/libclone.h
> b/testcases/kernel/containers/libclone/libclone.h
> index 9380cec..6a2d66d 100644
> --- a/testcases/kernel/containers/libclone/libclone.h
> +++ b/testcases/kernel/containers/libclone/libclone.h
> @@ -77,8 +77,6 @@
> #define CLONE_NEWNET 0x40000000
> #endif
>
> -extern int create_net_namespace(char *, char *);
> -
> /*
> * Run fn1 in a unshared environmnent, and fn2 in the original context
> * Fn2 may be NULL.
> diff --git a/testcases/kernel/containers/netns/common.c
> b/testcases/kernel/containers/netns/common.c
> index 291aeb7..67e1a2e 100644
> --- a/testcases/kernel/containers/netns/common.c
> +++ b/testcases/kernel/containers/netns/common.c
> @@ -26,23 +26,7 @@
>
> #define _GNU_SOURCE
>
> -#include <sys/utsname.h>
> -#include <sched.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <sys/syscall.h>
> -#include <unistd.h>
> -#include <signal.h>
> -#include <string.h>
> -#include <errno.h>
> -#include <libgen.h>
> -#include <fcntl.h>
> -#include <inttypes.h>
> -#include <sys/types.h>
> -#include <sys/wait.h>
> -#include "libclone.h"
> -#include "test.h"
> -#include "config.h"
These should have stayed here, only headers that are needed for types
used in the common.h header should be moved there (if I'm looking right
theare are none in this case).
> +#include "common.h"
>
> static int child_fn(void *c1);
>
> diff --git a/testcases/kernel/containers/netns/common.h
> b/testcases/kernel/containers/netns/common.h
> new file mode 100644
> index 0000000..c769a7f
> --- /dev/null
> +++ b/testcases/kernel/containers/netns/common.h
> @@ -0,0 +1,47 @@
> +/*
> +* This program is free software; you can redistribute it and/or modify
> +* it under the terms of the GNU General Public License as published by
> +* the Free Software Foundation; either version 2 of the License, or
> +* (at your option) any later version.
> +*
> +* This program is distributed in the hope that it will be useful,
> +* but WITHOUT ANY WARRANTY; without even the implied warranty of
> +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
> +* the GNU General Public License for more details.
> +* You should have received a copy of the GNU General Public License
> +* along with this program; if not, write to the Free Software
> +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> +*
> +***************************************************************************/
> +/*=========================================================================
> +* This testcase creates the network namespace.
> +* It creates veth pair veth8 & veth9. Also assigns IP addresses to the
> childNS.
> +* Also it starts the sshd daemon @ port 7890
> +*
> +* Scripts Used: parentns.sh childns.sh
> +*
> +* Author: Veerendra <veeren@linux.vnet.ibm.com>
> +=========================================================================*/
I would omit this comment, it does not add any usefull information, just
keep the license here.
> +#include <sys/utsname.h>
> +#include <sched.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <sys/syscall.h>
> +#include <unistd.h>
> +#include <signal.h>
> +#include <string.h>
> +#include <errno.h>
> +#include <libgen.h>
> +#include <fcntl.h>
> +#include <inttypes.h>
> +#include <sys/types.h>
> +#include <sys/wait.h>
> +#include "libclone.h"
> +#include "test.h"
> +#include "config.h"
> +
> +int crtchild(char *s1, char *s2);
> +
> +int create_net_namespace(char *p1, char *c1);
You shoud add include guards around the header includes and prototypes.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-04-17 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 9:40 [LTP] [PATCH v2] containers/netns:parameters are not correct when calling, crtchild() function Shuang Qiu
2014-04-17 12:50 ` chrubis [this message]
2014-04-18 11:36 ` [LTP] [PATCH v3] " Shuang Qiu
2014-04-22 12:20 ` chrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140417125003.GA949@rei \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=shuang.qiu@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox