Commit 0c3720a3 by KATOH Yasufumi Committed by Serge Hallyn

lxc-config can show lxc.cgroup.(use|pattern)

parent 4167102e
...@@ -36,6 +36,8 @@ static struct lxc_config_items items[] = ...@@ -36,6 +36,8 @@ static struct lxc_config_items items[] =
{ .name = "lxc.bdev.lvm.vg", }, { .name = "lxc.bdev.lvm.vg", },
{ .name = "lxc.bdev.lvm.thin_pool", }, { .name = "lxc.bdev.lvm.thin_pool", },
{ .name = "lxc.bdev.zfs.root", }, { .name = "lxc.bdev.zfs.root", },
{ .name = "lxc.cgroup.use", },
{ .name = "lxc.cgroup.pattern", },
{ .name = NULL, }, { .name = NULL, },
}; };
...@@ -58,6 +60,7 @@ static void list_config_items(void) ...@@ -58,6 +60,7 @@ static void list_config_items(void)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
struct lxc_config_items *i; struct lxc_config_items *i;
const char *value;
if (argc < 2) if (argc < 2)
usage(argv[0]); usage(argv[0]);
...@@ -65,7 +68,11 @@ int main(int argc, char *argv[]) ...@@ -65,7 +68,11 @@ int main(int argc, char *argv[])
list_config_items(); list_config_items();
for (i = &items[0]; i->name; i++) { for (i = &items[0]; i->name; i++) {
if (strcmp(argv[1], i->name) == 0) { if (strcmp(argv[1], i->name) == 0) {
printf("%s\n", lxc_get_global_config_item(i->name)); value = lxc_get_global_config_item(i->name);
if (value)
printf("%s\n", value);
else
printf("%s is not set.\n", argv[1]);
exit(0); exit(0);
} }
} }
......
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