mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
mount: Dump external bind-mounts with plugins
External bind mounts are those with source sitting outside of the current FS view. Such are detected in validate_mounts(), so we just go ahead and call plugins. The plugin is provided with the mountpoint to decide whether it's his or not (what else does the guy need?) and an ID with this it can identify the mountpoint in /proc. The same ID will be used at restore time to find the needed restore info. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
9
plugin.c
9
plugin.c
@@ -19,6 +19,7 @@ struct cr_plugin_entry {
|
||||
cr_plugin_restore_unix_sk_t *cr_plugin_restore_unix_sk;
|
||||
cr_plugin_dump_file_t *cr_plugin_dump_file;
|
||||
cr_plugin_restore_file_t *cr_plugin_restore_file;
|
||||
cr_plugin_dump_ext_mount_t *cr_plugin_dump_ext_mount;
|
||||
};
|
||||
|
||||
struct cr_plugin_entry *next;
|
||||
@@ -31,6 +32,7 @@ struct cr_plugins {
|
||||
struct cr_plugin_entry *cr_plugin_restore_unix_sk;
|
||||
struct cr_plugin_entry *cr_plugin_dump_file;
|
||||
struct cr_plugin_entry *cr_plugin_restore_file;
|
||||
struct cr_plugin_entry *cr_plugin_dump_ext_mount;
|
||||
};
|
||||
|
||||
struct cr_plugins cr_plugins;
|
||||
@@ -87,6 +89,11 @@ int cr_plugin_restore_file(int id)
|
||||
return run_plugin_funcs(cr_plugin_restore_file, id);
|
||||
}
|
||||
|
||||
int cr_plugin_dump_ext_mount(char *mountpoint, int id)
|
||||
{
|
||||
return run_plugin_funcs(cr_plugin_dump_ext_mount, mountpoint, id);
|
||||
}
|
||||
|
||||
static int cr_lib_load(char *path)
|
||||
{
|
||||
struct cr_plugin_entry *ce;
|
||||
@@ -106,6 +113,8 @@ static int cr_lib_load(char *path)
|
||||
add_plugin_func(cr_plugin_dump_file);
|
||||
add_plugin_func(cr_plugin_restore_file);
|
||||
|
||||
add_plugin_func(cr_plugin_dump_ext_mount);
|
||||
|
||||
ce = NULL;
|
||||
f_fini = dlsym(h, "cr_plugin_fini");
|
||||
if (f_fini) {
|
||||
|
Reference in New Issue
Block a user