static const size_t config_jump_table_size = sizeof(config_jump_table) / sizeof(struct lxc_config_t);
+struct lxc_config_t *lxc_get_config_exact(const char *key)
+{
+ size_t i;
+
+ for (i = 0; i < config_jump_table_size; i++)
+ if (!strcmp(config_jump_table[i].name, key))
+ return &config_jump_table[i];
+
+ return NULL;
+}
+
+
struct lxc_config_t *lxc_get_config(const char *key)
{
size_t i;
};
/* Get the jump table entry for the given configuration key. */
+__hidden extern struct lxc_config_t *lxc_get_config_exact(const char *key);
+
+/* Get the jump table entry if entry name is a prefix of the given configuration key. */
__hidden extern struct lxc_config_t *lxc_get_config(const char *key);
/* List all available config items. */
bool lxc_config_item_is_supported(const char *key)
{
- return !!lxc_get_config(key);
+ return !!lxc_get_config_exact(key);
}
bool lxc_has_api_extension(const char *extension)
goto out;
}
+ if (lxc_config_item_is_supported("lxc.arch.nonsense")) {
+ fprintf(stderr, "%d: failed to detect \"lxc.arch.nonsense\" as unsupported configuration item\n", __LINE__);
+ goto out;
+ }
+
if (c->set_config_item(c, "lxc.notaconfigkey", "invalid")) {
fprintf(stderr, "%d: Managed to set \"lxc.notaconfigkey\"\n", __LINE__);
goto out;