Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
9f1f54b0
Commit
9f1f54b0
authored
Nov 02, 2016
by
Tycho Andersen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c/r: remove extra \ns from logs
The macros put a \n in for us, so let's not put another one in. Signed-off-by:
Tycho Andersen
<
tycho.andersen@canonical.com
>
parent
5af85cb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
criu.c
src/lxc/criu.c
+15
-15
No files found.
src/lxc/criu.c
View file @
9f1f54b0
...
@@ -216,7 +216,7 @@ static void exec_criu(struct criu_opts *opts)
...
@@ -216,7 +216,7 @@ static void exec_criu(struct criu_opts *opts)
ret
=
snprintf
(
log
,
PATH_MAX
,
"%s/%s.log"
,
opts
->
user
->
directory
,
opts
->
action
);
ret
=
snprintf
(
log
,
PATH_MAX
,
"%s/%s.log"
,
opts
->
user
->
directory
,
opts
->
action
);
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
{
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
{
ERROR
(
"logfile name too long
\n
"
);
ERROR
(
"logfile name too long"
);
return
;
return
;
}
}
...
@@ -239,7 +239,7 @@ static void exec_criu(struct criu_opts *opts)
...
@@ -239,7 +239,7 @@ static void exec_criu(struct criu_opts *opts)
argv
[
argc
++
]
=
on_path
(
"criu"
,
NULL
);
argv
[
argc
++
]
=
on_path
(
"criu"
,
NULL
);
if
(
!
argv
[
argc
-
1
])
{
if
(
!
argv
[
argc
-
1
])
{
ERROR
(
"Couldn't find criu binary
\n
"
);
ERROR
(
"Couldn't find criu binary"
);
goto
err
;
goto
err
;
}
}
...
@@ -506,7 +506,7 @@ static void exec_criu(struct criu_opts *opts)
...
@@ -506,7 +506,7 @@ static void exec_criu(struct criu_opts *opts)
break
;
break
;
case
LXC_NET_MACVLAN
:
case
LXC_NET_MACVLAN
:
if
(
!
n
->
link
)
{
if
(
!
n
->
link
)
{
ERROR
(
"no host interface for macvlan %s
\n
"
,
n
->
name
);
ERROR
(
"no host interface for macvlan %s"
,
n
->
name
);
goto
err
;
goto
err
;
}
}
...
@@ -519,7 +519,7 @@ static void exec_criu(struct criu_opts *opts)
...
@@ -519,7 +519,7 @@ static void exec_criu(struct criu_opts *opts)
break
;
break
;
default:
default:
/* we have screened for this earlier... */
/* we have screened for this earlier... */
ERROR
(
"unexpected network type %d
\n
"
,
n
->
type
);
ERROR
(
"unexpected network type %d"
,
n
->
type
);
goto
err
;
goto
err
;
}
}
...
@@ -670,7 +670,7 @@ version_match:
...
@@ -670,7 +670,7 @@ version_match:
version_error:
version_error:
fclose
(
f
);
fclose
(
f
);
free
(
tmp
);
free
(
tmp
);
ERROR
(
"must have criu "
CRIU_VERSION
" or greater to checkpoint/restore
\n
"
);
ERROR
(
"must have criu "
CRIU_VERSION
" or greater to checkpoint/restore"
);
return
false
;
return
false
;
}
}
}
}
...
@@ -685,7 +685,7 @@ static bool criu_ok(struct lxc_container *c, char **criu_version)
...
@@ -685,7 +685,7 @@ static bool criu_ok(struct lxc_container *c, char **criu_version)
return
false
;
return
false
;
if
(
geteuid
())
{
if
(
geteuid
())
{
ERROR
(
"Must be root to checkpoint
\n
"
);
ERROR
(
"Must be root to checkpoint"
);
return
false
;
return
false
;
}
}
...
@@ -699,7 +699,7 @@ static bool criu_ok(struct lxc_container *c, char **criu_version)
...
@@ -699,7 +699,7 @@ static bool criu_ok(struct lxc_container *c, char **criu_version)
case
LXC_NET_MACVLAN
:
case
LXC_NET_MACVLAN
:
break
;
break
;
default:
default:
ERROR
(
"Found un-dumpable network: %s (%s)
\n
"
,
lxc_net_type_to_str
(
n
->
type
),
n
->
name
);
ERROR
(
"Found un-dumpable network: %s (%s)"
,
lxc_net_type_to_str
(
n
->
type
),
n
->
name
);
return
false
;
return
false
;
}
}
}
}
...
@@ -885,7 +885,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
...
@@ -885,7 +885,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
buf
[
n
]
=
0
;
buf
[
n
]
=
0
;
ERROR
(
"criu process exited %d, output:
\n
%s
\n
"
,
WEXITSTATUS
(
status
),
buf
);
ERROR
(
"criu process exited %d, output:
\n
%s"
,
WEXITSTATUS
(
status
),
buf
);
goto
out_fini_handler
;
goto
out_fini_handler
;
}
else
{
}
else
{
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"/proc/self/task/%lu/children"
,
(
unsigned
long
)
syscall
(
__NR_gettid
));
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"/proc/self/task/%lu/children"
,
(
unsigned
long
)
syscall
(
__NR_gettid
));
...
@@ -896,7 +896,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
...
@@ -896,7 +896,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
FILE
*
f
=
fopen
(
buf
,
"r"
);
FILE
*
f
=
fopen
(
buf
,
"r"
);
if
(
!
f
)
{
if
(
!
f
)
{
SYSERROR
(
"couldn't read restore's children file %s
\n
"
,
buf
);
SYSERROR
(
"couldn't read restore's children file %s"
,
buf
);
goto
out_fini_handler
;
goto
out_fini_handler
;
}
}
...
@@ -913,7 +913,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
...
@@ -913,7 +913,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
}
}
}
}
}
else
{
}
else
{
ERROR
(
"CRIU was killed with signal %d
\n
"
,
WTERMSIG
(
status
));
ERROR
(
"CRIU was killed with signal %d"
,
WTERMSIG
(
status
));
goto
out_fini_handler
;
goto
out_fini_handler
;
}
}
...
@@ -1093,16 +1093,16 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
...
@@ -1093,16 +1093,16 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
if
(
WIFEXITED
(
status
))
{
if
(
WIFEXITED
(
status
))
{
if
(
WEXITSTATUS
(
status
))
{
if
(
WEXITSTATUS
(
status
))
{
ERROR
(
"dump failed with %d
\n
"
,
WEXITSTATUS
(
status
));
ERROR
(
"dump failed with %d"
,
WEXITSTATUS
(
status
));
ret
=
false
;
ret
=
false
;
}
else
{
}
else
{
ret
=
true
;
ret
=
true
;
}
}
}
else
if
(
WIFSIGNALED
(
status
))
{
}
else
if
(
WIFSIGNALED
(
status
))
{
ERROR
(
"dump signaled with %d
\n
"
,
WTERMSIG
(
status
));
ERROR
(
"dump signaled with %d"
,
WTERMSIG
(
status
));
ret
=
false
;
ret
=
false
;
}
else
{
}
else
{
ERROR
(
"unknown dump exit %d
\n
"
,
status
);
ERROR
(
"unknown dump exit %d"
,
status
);
ret
=
false
;
ret
=
false
;
}
}
...
@@ -1132,7 +1132,7 @@ bool __criu_dump(struct lxc_container *c, struct migrate_opts *opts)
...
@@ -1132,7 +1132,7 @@ bool __criu_dump(struct lxc_container *c, struct migrate_opts *opts)
return
false
;
return
false
;
if
(
access
(
path
,
F_OK
)
==
0
)
{
if
(
access
(
path
,
F_OK
)
==
0
)
{
ERROR
(
"please use a fresh directory for the dump directory
\n
"
);
ERROR
(
"please use a fresh directory for the dump directory"
);
return
false
;
return
false
;
}
}
...
@@ -1150,7 +1150,7 @@ bool __criu_restore(struct lxc_container *c, struct migrate_opts *opts)
...
@@ -1150,7 +1150,7 @@ bool __criu_restore(struct lxc_container *c, struct migrate_opts *opts)
return
false
;
return
false
;
if
(
geteuid
())
{
if
(
geteuid
())
{
ERROR
(
"Must be root to restore
\n
"
);
ERROR
(
"Must be root to restore"
);
return
false
;
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment