]>
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.
19 #include <lxc/lxccontainer.h>
26 #include <sys/types.h>
33 #include "lxc/state.h"
36 int main(int argc
, char *argv
[])
38 int fulllen
= 0, inlen
= 0, ret
= EXIT_FAILURE
;
39 char *key
, *keys
, *saveptr
= NULL
;
41 fulllen
= lxc_list_config_items(NULL
, inlen
);
43 keys
= malloc(sizeof(char) * fulllen
+ 1);
45 lxc_error("%s\n", "failed to allocate memory");
49 if (lxc_list_config_items(keys
, fulllen
) != fulllen
) {
50 lxc_error("%s\n", "failed to retrieve configuration keys");
54 for (key
= strtok_r(keys
, "\n", &saveptr
); key
!= NULL
;
55 key
= strtok_r(NULL
, "\n", &saveptr
)) {
56 struct lxc_config_t
*config
;
57 config
= lxc_get_config(key
);
59 lxc_error("configuration key \"%s\" not implemented in "
66 lxc_error("configuration key \"%s\" has no set method "
73 lxc_error("configuration key \"%s\" has no get method "
80 lxc_error("configuration key \"%s\" has no clr (clear) "
81 "method in jump table",