]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/lxc_config.c
3 * Copyright © 2012 Serge Hallyn <serge.hallyn@ubuntu.com>.
4 * Copyright © 2012 Canonical Ltd.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <lxc/lxccontainer.h>
28 struct lxc_config_items
{
32 static struct lxc_config_items items
[] =
34 { .name
= "lxc.default_config", },
35 { .name
= "lxc.lxcpath", },
36 { .name
= "lxc.bdev.lvm.vg", },
37 { .name
= "lxc.bdev.lvm.thin_pool", },
38 { .name
= "lxc.bdev.zfs.root", },
39 { .name
= "lxc.cgroup.use", },
40 { .name
= "lxc.cgroup.pattern", },
44 static void usage(char *me
)
46 printf("Usage: %s -l: list all available configuration items\n", me
);
47 printf(" %s item: print configuration item\n", me
);
51 static void list_config_items(void)
53 struct lxc_config_items
*i
;
55 for (i
= &items
[0]; i
->name
; i
++)
56 printf("%s\n", i
->name
);
60 int main(int argc
, char *argv
[])
62 struct lxc_config_items
*i
;
67 if (strcmp(argv
[1], "-l") == 0)
69 for (i
= &items
[0]; i
->name
; i
++) {
70 if (strcmp(argv
[1], i
->name
) == 0) {
71 value
= lxc_get_global_config_item(i
->name
);
73 printf("%s\n", value
);
75 printf("%s is not set.\n", argv
[1]);
79 printf("Unknown configuration item: %s\n", argv
[1]);