2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 21:07:43 +00:00

21 Commits

Author SHA1 Message Date
Pavel Emelyanov
01e88d1c87 rpc: Add ability to specify veth pairs (--veth-pair option)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-12 00:33:02 +04:00
Cyrill Gorcunov
291aa3f6d6 headers: Add extern specificator to functions
We really have a mess of extern/non-extern declaration
of functions in our headers. Always use extern for
unification purpose.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 17:00:58 +04:00
Andrey Vagin
faf7b94868 netns: don't use global fdset for dumping namespace
We are going to replace pid on id in names of image files. The id is
uniq for each namespace, so it's more convient, if image files are
opened per namespace.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-01 12:10:45 +04:00
Pavel Emelyanov
b18fb09eb9 show: Replace one-line show_foo calls with args array
We have generic do_pb_show() call and tons of show_foo
routines, that just call one with proper args. Compact
the code by putting the args into array and calling
the do_pb_show() in one place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-24 04:00:32 +04:00
Pavel Emelyanov
92cc20c07c net: Ability to restore existing link's params with rtm
TUN devices are created with ioctl, but their parameters (e.g.
flags with state, mtu, etc.) are to be restored with generic
RTM_SETLINK message.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 18:46:48 +04:00
Pavel Emelyanov
4869da1781 net: Read ns' sysfs file helper
Just a small helper, that reads string from ns' sysfs mount.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 16:14:37 +04:00
Pavel Emelyanov
c7afbae598 net: Prepare to dump netdev entry with extentions
Some (most) network devices would like to have NetDeviceEntry with
more fields, than currently present (and enough for lo and veth).
Prepare for that by allowing them to define their own callback that
would fill the resor of the pb entry and call write_netdev_img().

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 16:08:46 +04:00
Pavel Emelyanov
6bf22f8c75 crtools: Get rid of on-stack cr_options
We have global instance of them, that's enough.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-28 21:11:13 +04:00
Pavel Emelyanov
add21b75c9 show: Remove options args from ->show callback
This thing is global, we can address one explicitly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:23:42 +04:00
Pavel Emelyanov
3a1c7d1d76 ns: Introduce ns descriptors
These are structs that (now) tie together ns string
and the CLONE_ flag. It's nice to have one (some code
becomes simpler) and will help us with auto-namespaces
detection.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 23:24:01 +04:00
Cyrill Gorcunov
830d92b0f0 headers: Unify include guards (in comments) and a few fixes
- fix names in comments
 - add empty lines where needed
 - fix rbtree.h
 - fix syscall-types.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-25 22:40:24 +04:00
Pavel Emelyanov
03d0758df3 Revert "net: Introduce netdev index to name resolver"
This reverts commit ef3771d566dacb8ee9fe71b744d56f08674fe3db.
With new SO_BINDTODEVICE getting API it's not required.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-28 20:27:16 +03:00
Pavel Emelyanov
ef3771d566 net: Introduce netdev index to name resolver
It will be required to support socket bound to devices.

When restoring w/o net namespaces -- collect existing devices.
When restoring with them -- collect what is received from image.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-19 17:35:46 +04:00
Andrey Vagin
3957a9a69a cr-dump: lock network before dump and unlock in case of errors
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-17 20:05:55 +04:00
Andrey Vagin
ae70bc0ad6 net: add ability to set names for outside links of veth devices
When restoring a container crtools create veth pair inside it and then
pushed one end to the namespaces crtools live in (outside). To facilitate
the subsequent management of the otter end of the veth pair this option
is added -- one can specifu a name by which the respective end would be
visible. E.g.: --veth-pair eth0=veth101.0

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-02 01:07:32 +04:00
Pavel Emelyanov
1a62282d48 net: Push the host end of a veth to original netns
The call will then have to handle this end (put into a bridge).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 19:14:36 +04:00
Andrey Vagin
d0fd98c9fc show: don't show RAW images in show_all
If an image isn't specified, crtool shows content of all images.
Now crtools aborts in this case due to BUG_ON(1) in show methods
for raw images. I sugget to skip such images.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 16:22:32 +04:00
Pavel Emelyanov
a6439860cd net: Routes dump and restore
Same here -- run ip tool and that's it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:31:46 +04:00
Pavel Emelyanov
fc1eb96783 netns: Ifaddrs dump and restore
Just run the ip addr save and ip addr restore respectively.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:26:43 +04:00
Pavel Emelyanov
4943eb43fd netns: Basic link dump, restore and show
Only support the lo device. This is not final yet (much more
stuff is to be handled for a link) but is rather a skeleton
showing how to do it and letting us check the LXC container
early.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:17:27 +04:00
Pavel Emelyanov
0a827aa96c net: Basic netns dump/restore skeleton
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:06:29 +04:00