[pve-devel] [PATCH RFC container] include custom lxc options when displaying config

Dietmar Maurer dietmar at proxmox.com
Wed Jun 15 12:27:51 CEST 2016


comments inline

...
> diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
> index ca87229..748ace3 100755
> --- a/src/PVE/CLI/pct.pm
> +++ b/src/PVE/CLI/pct.pm
> @@ -542,12 +542,22 @@ our $cmddef = {
>  		    my $config = shift;
>  		    foreach my $k (sort (keys %$config)) {
>  			next if $k eq 'digest';
> +			next if $k eq 'lxc';
>  			my $v = $config->{$k};
>  			if ($k eq 'description') {
>  			    $v = PVE::Tools::encode_text($v);
>  			}
>  			print "$k: $v\n";
>  		    }
> +		    if (defined($config->{'lxc'})) {
> +			my $lxc_list = $config->{'lxc'};
> +			foreach my $lxc_opt (@$lxc_list) {
> +			    if (@$lxc_opt == 2) {

why is above test required? AFAIK we always do:

 push @{$conf->{lxc}}, [$key, $value];


> +				my $v = PVE::Tools::encode_text(@$lxc_opt[1]);

why do you call PVE::Tools::encode_text() here?

> +				print "@$lxc_opt[0]: $v\n"
> +			    }
> +			}
> +		    }
>  		}],
>      set => [ 'PVE::API2::LXC::Config', 'update_vm', ['vmid'], { node =>
> $nodename }],
>  
> -- 
> 2.1.4



More information about the pve-devel mailing list