[CRIU] [PATCH 1/2] crtools: add init_opts
Cyrill Gorcunov
gorcunov at gmail.com
Mon Oct 28 04:10:41 PDT 2013
On Mon, Oct 28, 2013 at 03:04:43PM +0400, Pavel Emelyanov wrote:
> >
> > Merge it, we'll cleanup it on top I think.
>
> No. Clean up before I merge.
Just drop "(void)" in memset call while merging it, not a big deal.
You can simply edit patch body directly, attached.
-------------- next part --------------
From: Ruslan Kuprieiev <kupruser at gmail.com>
Subject: crtools: add init_opts
Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
diff --git a/crtools.c b/crtools.c
index fe725bf..8e3fef1 100644
--- a/crtools.c
+++ b/crtools.c
@@ -33,6 +33,16 @@
struct cr_options opts;
+void init_opts(void)
+{
+ memset(&opts, 0, sizeof(opts));
+
+ /* Default options */
+ opts.final_state = TASK_DEAD;
+ INIT_LIST_HEAD(&opts.veth_pairs);
+ INIT_LIST_HEAD(&opts.scripts);
+}
+
static int parse_ns_string(const char *ptr)
{
const char *end = ptr + strlen(ptr);
@@ -77,10 +87,7 @@ int main(int argc, char *argv[])
if (argc < 2)
goto usage;
- /* Default options */
- opts.final_state = TASK_DEAD;
- INIT_LIST_HEAD(&opts.veth_pairs);
- INIT_LIST_HEAD(&opts.scripts);
+ init_opts();
if (init_service_fd())
return -1;
diff --git a/include/crtools.h b/include/crtools.h
index 8548869..d6072a8 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -48,6 +48,8 @@ struct cr_options {
extern struct cr_options opts;
+extern void init_opts(void);
+
enum sfd_type {
SERVICE_FD_MIN,
--
More information about the CRIU
mailing list