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
b73513b8
Unverified
Commit
b73513b8
authored
Aug 15, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "storage: switch to new rsync functions"
This reverts commit
a493a694
. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
97f208bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
bdev.c
src/lxc/bdev/bdev.c
+24
-19
No files found.
src/lxc/bdev/bdev.c
View file @
b73513b8
...
@@ -326,6 +326,7 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
...
@@ -326,6 +326,7 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
const
char
*
bdevdata
,
uint64_t
newsize
,
int
*
needs_rdep
)
const
char
*
bdevdata
,
uint64_t
newsize
,
int
*
needs_rdep
)
{
{
struct
bdev
*
orig
,
*
new
;
struct
bdev
*
orig
,
*
new
;
pid_t
pid
;
int
ret
;
int
ret
;
char
*
src_no_prefix
;
char
*
src_no_prefix
;
bool
snap
=
flags
&
LXC_CLONE_SNAPSHOT
;
bool
snap
=
flags
&
LXC_CLONE_SNAPSHOT
;
...
@@ -335,7 +336,6 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
...
@@ -335,7 +336,6 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
const
char
*
oldname
=
c0
->
name
;
const
char
*
oldname
=
c0
->
name
;
const
char
*
oldpath
=
c0
->
config_path
;
const
char
*
oldpath
=
c0
->
config_path
;
struct
rsync_data
data
;
struct
rsync_data
data
;
char
cmd_output
[
MAXPATHLEN
];
/* If the container name doesn't show up in the rootfs path, then we
/* If the container name doesn't show up in the rootfs path, then we
* don't know how to come up with a new name.
* don't know how to come up with a new name.
...
@@ -475,28 +475,33 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
...
@@ -475,28 +475,33 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
return
new
;
return
new
;
/* rsync the contents from source to target */
/* rsync the contents from source to target */
data
.
orig
=
orig
;
pid
=
fork
();
data
.
new
=
new
;
if
(
pid
<
0
)
{
if
(
am_unpriv
())
{
SYSERROR
(
"fork"
);
ret
=
userns_exec_1
(
c0
->
lxc_conf
,
lxc_rsync_exec_wrapper
,
&
data
,
goto
err
;
"lxc_rsync_exec_wrapper"
);
}
if
(
ret
<
0
)
{
ERROR
(
"Failed to rsync from
\"
%s
\"
into
\"
%s
\"
"
,
if
(
pid
>
0
)
{
orig
->
dest
,
new
->
dest
);
int
ret
=
wait_for_pid
(
pid
);
goto
err
;
bdev_put
(
orig
);
}
}
else
{
ret
=
run_command
(
cmd_output
,
sizeof
(
cmd_output
),
lxc_rsync_exec_wrapper
,
(
void
*
)
&
data
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to rsync from
\"
%s
\"
into
\"
%s
\"
: %s"
,
bdev_put
(
new
);
orig
->
dest
,
new
->
dest
,
cmd_output
);
return
NULL
;
goto
err
;
}
}
return
new
;
}
}
bdev_put
(
orig
);
data
.
orig
=
orig
;
return
new
;
data
.
new
=
new
;
if
(
am_unpriv
())
ret
=
userns_exec_1
(
c0
->
lxc_conf
,
rsync_rootfs_wrapper
,
&
data
,
"rsync_rootfs_wrapper"
);
else
ret
=
rsync_rootfs
(
&
data
);
if
(
ret
<
0
)
ERROR
(
"Failed to rsync from"
);
exit
(
ret
==
0
?
0
:
1
);
err:
err:
bdev_put
(
orig
);
bdev_put
(
orig
);
...
...
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