From e96a0ceb888789829b04959c62721e144275415f Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 4 Jul 2016 15:36:16 +0200 Subject: [PATCH 1/1] allow deleting of container hostname since we allow to create a container without hostname (we are using localhost by default then) and hostname is marked optional in the JSONSchema of the config we should be able to delete the hostname Signed-off-by: Dominik Csapak --- src/PVE/LXC/Config.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 7988203..cfe952f 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -766,8 +766,10 @@ sub update_pct_config { next; } - if ($opt eq 'hostname' || $opt eq 'memory' || $opt eq 'rootfs') { + if ($opt eq 'memory' || $opt eq 'rootfs') { die "unable to delete required option '$opt'\n"; + } elsif ($opt eq 'hostname') { + delete $conf->{$opt}; } elsif ($opt eq 'swap') { delete $conf->{$opt}; PVE::LXC::write_cgroup_value("memory", $vmid, -- 2.39.2