]>
git.proxmox.com Git - mirror_lxc.git/blob - src/tests/config_jump_table.c
3 * Copyright © 2017 Christian Brauner <christian.brauner@ubuntu.com>.
4 * Copyright © 2017 Canonical Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <lxc/lxccontainer.h>
29 #include <sys/types.h>
39 int main(int argc
, char *argv
[])
41 int fulllen
= 0, inlen
= 0, ret
= EXIT_FAILURE
;
42 char *key
, *keys
, *saveptr
= NULL
;
44 fulllen
= lxc_list_config_items(NULL
, inlen
);
46 keys
= malloc(sizeof(char) * fulllen
+ 1);
48 lxc_error("%s\n", "failed to allocate memory");
52 if (lxc_list_config_items(keys
, fulllen
) != fulllen
) {
53 lxc_error("%s\n", "failed to retrieve configuration keys");
57 for (key
= strtok_r(keys
, "\n", &saveptr
); key
!= NULL
;
58 key
= strtok_r(NULL
, "\n", &saveptr
)) {
59 struct lxc_config_t
*config
;
61 config
= lxc_get_config(key
);
63 lxc_error("configuration key \"%s\" not implemented in "
70 lxc_error("configuration key \"%s\" has no set method "
77 lxc_error("configuration key \"%s\" has no get method "
84 lxc_error("configuration key \"%s\" has no clr (clear) "
85 "method in jump table",