[pve-devel] [PATCH container] allow deleting of container hostname

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Jul 25 09:34:49 CEST 2016


applied

On Mon, Jul 04, 2016 at 03:36:16PM +0200, Dominik Csapak wrote:
> 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 <d.csapak at proxmox.com>
> ---
>  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 0ad32f4..854b509 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -737,8 +737,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.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list