nspawn-settings.c revision 0e2656744f6d2e2cf65788a497f266d469865e30
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen This file is part of systemd.
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen Copyright 2015 Lennart Poettering
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen systemd is free software; you can redistribute it and/or modify it
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen under the terms of the GNU Lesser General Public License as published by
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen the Free Software Foundation; either version 2.1 of the License, or
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen (at your option) any later version.
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen systemd is distributed in the hope that it will be useful, but
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen Lesser General Public License for more details.
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen You should have received a copy of the GNU Lesser General Public License
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
a501033335ed402c8f7e86fe41a15531ba69abd7Tom Gundersenint settings_load(FILE *f, const char *path, Settings **ret) {
9a4b012e43f23516373bf398dd9a458439d19939Tom Gundersen custom_mount_free_all(s->custom_mounts, s->n_custom_mounts);
43b3a5ef61859f06cdbaf26765cab8e1adac4296Tom GundersenDEFINE_CONFIG_PARSE_ENUM(config_parse_volatile_mode, volatile_mode, VolatileMode, "Failed to parse volatile mode");
9a4b012e43f23516373bf398dd9a458439d19939Tom Gundersen r = expose_port_parse(&s->expose_ports, rvalue);
9a4b012e43f23516373bf398dd9a458439d19939Tom Gundersen log_syntax(unit, LOG_ERR, filename, line, r, "Duplicate port specification, ignoring: %s", rvalue);
9a4b012e43f23516373bf398dd9a458439d19939Tom Gundersen log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse host port %s: %m", rvalue);
ed88bcfb7c15029f9fc95ee2380759a9eb782d46Zbigniew Jędrzejewski-Szmek _cleanup_free_ char *word = NULL;
ecb08ec6a5c52f2d940f3b8147e2a480affd46e1Zbigniew Jędrzejewski-Szmek r = extract_first_word(&rvalue, &word, NULL, 0);
5fde13d748749f0e06e2e6cdd15f0980a79ea82cTom Gundersen log_syntax(unit, LOG_ERR, filename, line, r, "Failed to extract capability string, ignoring: %s", rvalue);
e9f3d2d508bfd9fb5b54e82994bda365a71eb864Zbigniew Jędrzejewski-Szmek cap = capability_from_name(word);
36f822c4bd077f9121757e24b6516e5c7ada63b5Zbigniew Jędrzejewski-Szmek log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse capability, ignoring: %s", word);
edf029b7fd9a5853a87d3ca99aac2922bb8a277eTom Gundersen log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse 128bit ID/UUID, ignoring: %s", rvalue);
af6f0d422c521374ee6a2dd92df5935a5a476ae5Tom Gundersen r = bind_mount_parse(&settings->custom_mounts, &settings->n_custom_mounts, rvalue, ltype);
464cf22f17e0cf2d8bfa6d72b5e7a662d634f149Tom Gundersen log_syntax(unit, LOG_ERR, filename, line, r, "Invalid bind mount specification %s: %m", rvalue);
ca6038b89645c0c1bd547d6a420bf95eb3d6f4ccTom Gundersen r = tmpfs_mount_parse(&settings->custom_mounts, &settings->n_custom_mounts, rvalue);
32bc8adcd836baff68e4d0f53b9a382f358cccf8Tom Gundersen log_syntax(unit, LOG_ERR, filename, line, r, "Invalid temporary file system specification %s: %m", rvalue);