Commit ff1a751a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

opt: cpu-cap -- Introduce "none" and "cpuinfo" arguments

They will serve to choose capability level when migrating
images between various hardware nodes.

Note it's bare functionality introduced in this commit,
the real implementation is in next patches.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 88f488e3
......@@ -114,8 +114,12 @@ static int parse_cpu_cap(struct cr_options *opts, const char *optarg)
if (!strncmp(optarg, "fpu", 3))
____cpu_set_cap(opts, CPU_CAP_FPU, inverse);
if (!strncmp(optarg, "all", 3))
else if (!strncmp(optarg, "all", 3))
____cpu_set_cap(opts, CPU_CAP_ALL, inverse);
else if (!strncmp(optarg, "none", 3))
____cpu_set_cap(opts, CPU_CAP_NONE, inverse);
else if (!strncmp(optarg, "cpu", 3))
____cpu_set_cap(opts, CPU_CAP_CPU, inverse);
else
goto Esyntax;
}
......@@ -561,8 +565,8 @@ usage:
" --pidfile FILE write root task, service or page-server pid to FILE\n"
" -W|--work-dir DIR directory to cd and write logs/pidfiles/stats to\n"
" (if not specified, value of --images-dir is used)\n"
" --cpu-cap CAP require certain cpu capability. CAP: may be one of:\n"
" 'fpu','all'. To disable capability, prefix it with '^'.\n"
" --cpu-cap [CAP] require certain cpu capability. CAP: may be one of:\n"
" 'cpu','fpu','all','none'. To disable capability, prefix it with '^'.\n"
" --exec-cmd execute the command specified after '--' on successful\n"
" restore making it the parent of the restored process\n"
"\n"
......
......@@ -8,8 +8,11 @@
/*
* CPU capability options.
*/
#define CPU_CAP_FPU (1u)
#define CPU_CAP_NONE (0u)
#define CPU_CAP_ALL (-1u)
#define CPU_CAP_FPU (1u) /* Only FPU capability required */
#define CPU_CAP_CPU (2u) /* CPU capability required */
#define CPU_CAP_DEFAULT (CPU_CAP_FPU)
struct cg_root_opt {
struct list_head node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment