nspawn-settings.c revision b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering This file is part of systemd.
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering Copyright 2015 Lennart Poettering
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering systemd is free software; you can redistribute it and/or modify it
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering under the terms of the GNU Lesser General Public License as published by
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering (at your option) any later version.
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering systemd is distributed in the hope that it will be useful, but
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering Lesser General Public License for more details.
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering You should have received a copy of the GNU Lesser General Public License
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poetteringint settings_load(FILE *f, const char *path, Settings **ret) {
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering _cleanup_(settings_freep) Settings *s = NULL;
6bedfcbb2970e06a4d3280c8fb62083d252ede73Lennart Poettering s->volatile_mode = _VOLATILE_MODE_INVALID;
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering config_item_perf_lookup, nspawn_gperf_lookup,
13790add4bf648fed816361794d8277a75253410Lennart Poettering custom_mount_free_all(s->custom_mounts, s->n_custom_mounts);
13790add4bf648fed816361794d8277a75253410Lennart Poetteringbool settings_private_network(Settings *s) {
13790add4bf648fed816361794d8277a75253410Lennart PoetteringDEFINE_CONFIG_PARSE_ENUM(config_parse_volatile_mode, volatile_mode, VolatileMode, "Failed to parse volatile mode");
13790add4bf648fed816361794d8277a75253410Lennart Poettering r = expose_port_parse(&s->expose_ports, rvalue);
13790add4bf648fed816361794d8277a75253410Lennart Poettering log_syntax(unit, LOG_ERR, filename, line, r, "Duplicate port specification, ignoring: %s", rvalue);
13790add4bf648fed816361794d8277a75253410Lennart Poettering log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse host port %s: %m", rvalue);
13790add4bf648fed816361794d8277a75253410Lennart Poettering r = extract_first_word(&rvalue, &word, NULL, 0);
13790add4bf648fed816361794d8277a75253410Lennart Poettering log_syntax(unit, LOG_ERR, filename, line, r, "Failed to extract capability string, ignoring: %s", rvalue);
13790add4bf648fed816361794d8277a75253410Lennart Poettering log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse capability, ignoring: %s", word);
e22aa3d3284709234f086ebebc13a905a295b7a7Lennart Poettering log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse 128bit ID/UUID, ignoring: %s", rvalue);
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering r = bind_mount_parse(&settings->custom_mounts, &settings->n_custom_mounts, rvalue, ltype);
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering log_syntax(unit, LOG_ERR, filename, line, r, "Invalid bind mount specification %s: %m", rvalue);
a45b9fca6b91a767dcd9060cfcb30617dad234c7Lennart Poettering r = tmpfs_mount_parse(&settings->custom_mounts, &settings->n_custom_mounts, rvalue);
5ffa8c818120e35c89becd938d160235c069dd12Zbigniew Jędrzejewski-Szmek log_syntax(unit, LOG_ERR, filename, line, r, "Invalid temporary file system specification %s: %m", rvalue);