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

80 Commits

Author SHA1 Message Date
Andrey Vagin
3f3498bccd net: a file descriptor can be zero
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-15 18:53:00 +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
Huang Qiang
223dce83c2 fix many unclosed file opened by open_image_ro
Many image files opened by open_image_ro weren't closed before return, fix
them all in this patch.

Signed-off-by: Huang Qiang <h.huangqiang@huawei.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-24 16:51:50 +04: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
Pavel Emelyanov
f1fb3c740e net: Split dump_links into part
We'll need to dump links for another purpose, so prepare the
generic rtnl talker for that.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-19 17:34:47 +04:00
Andrey Vagin
e3fbb63080 crtools: use a special function for executing external utils
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-28 14:09:58 +04:00
Andrey Vagin
08e559b3f2 tcp: rename functions for unlocking tcp connections
One function is used on restoring and one is used on dumping,
so each function has own prefix rst or cpt.
The both functions have the same effect, so the main part of the names
is same and it describes "unlock_tcp_connections".

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-17 20:07:03 +04:00
Andrey Vagin
5ec8a1c313 cr-restore: unlock connections at the last moment
Restore must not fail after unlocking connections.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-17 20:06:14 +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
Cyrill Gorcunov
874fce48ec net: Use BUG() instead of BUG_ON(1)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-27 23:22:56 +04:00
Pavel Emelyanov
dffe544fe8 show: Show netdevice indices with %d
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 16:47:32 +04:00
Pavel Emelyanov
d10ee39f28 code: Fix checkpatch.pl warnings since v0.1
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-11 22:03:11 +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
Pavel Emelyanov
076faf7443 net: Preliminary veth restore
The peer device is named veth_host and is supposed to be pushed outside
the netns being restored for proper host-side configuration.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:36:00 +04:00
Pavel Emelyanov
3fee68f56b net: Put IFLA_LINKINFO attr on newlink if required
Veth will fill the linkinfo part for peer.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:32:56 +04:00
Pavel Emelyanov
9d18a851c2 net: Put ifname and mtu on newlink request
The name will be valid for new veth, mtu has to be restored for all devices.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:31:03 +04:00
Pavel Emelyanov
ff3770a22d net: Declare and expand a struct with newlink request
We need to add payload to NEWLINK request and will have to work with it outside the
restore_one_link fn.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:29:49 +04:00
Pavel Emelyanov
425ed1e92c net: Pass NLM_F_CREATE flag on link restore
This one is required to say, that we do want a new device is it doesn't exists.
This is so for all the devices except lo.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:25:42 +04:00
Pavel Emelyanov
4ae4c4acc9 net: Dump veth device
These devices can be distinguished by type ETHER and kind "veth".
Some problems with peer detection exists (described in comment), but
we cannot handle them at the moment.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:24:11 +04:00
Pavel Emelyanov
b57fb6da34 net: Move ifla parsing higher the call-stack
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-10 17:20:22 +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
657a544fb7 pb: Rewrite object showing to use pb-descs
The pb_show things are no longer macros.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:22:02 +04:00
Pavel Emelyanov
b1b0a39a58 pb: Rewrite object reading to use pb-descs
The pb_read thing is no longer a macros. This will allow to
factor out objects collecting on restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:22:00 +04:00
Pavel Emelyanov
2398c55e41 pb: Rewrite object writing to use pb-descs
The pb_write thing is no longer a macros.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:21:59 +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
0b9b1bd91a netns: Introduce a routine that runs ip tool for dump/restore
The thing is that the ip utililty is very likely to have support
for ifaddrs and routes dumping and restore (rtnl messages are
symmetrical wrt dump/restore and this can be easily dump in there).

Thus, the best we can do it just use this tool for that and carry
the "raw" images with ifaddrs and routes dump.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:21:19 +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