]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-config can show lxc.cgroup.(use|pattern)
authorKATOH Yasufumi <karma@jazz.email.ne.jp>
Tue, 30 Sep 2014 10:10:56 +0000 (19:10 +0900)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 20 Oct 2014 21:45:20 +0000 (16:45 -0500)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_config.c

index 0658beb8d8e77380f38129cf13a664e66462e2b1..d146ad863d8d1bb91d80718a52cf5772d5fa413c 100644 (file)
@@ -36,6 +36,8 @@ static struct lxc_config_items items[] =
        { .name = "lxc.bdev.lvm.vg", },
        { .name = "lxc.bdev.lvm.thin_pool", },
        { .name = "lxc.bdev.zfs.root", },
+       { .name = "lxc.cgroup.use", },
+       { .name = "lxc.cgroup.pattern", },
        { .name = NULL, },
 };
 
@@ -58,6 +60,7 @@ static void list_config_items(void)
 int main(int argc, char *argv[])
 {
        struct lxc_config_items *i;
+       const char *value;
 
        if (argc < 2)
                usage(argv[0]);
@@ -65,7 +68,11 @@ int main(int argc, char *argv[])
                list_config_items();
        for (i = &items[0]; i->name; i++) {
                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);
                }
        }