On 11/6/19 3:58 PM, Oguz Bektas wrote:
> apparently this was a regression introduced with the pending changes series.
> when creating/changing the network interface of a container, we need to use
> $print_lxc_network in order to have the correct property string in the config
> file.
> 
> Signed-off-by: Oguz Bektas <o.bek...@proxmox.com>
> ---
>  src/PVE/LXC/Config.pm | 5 +++++
>  1 file changed, 5 insertions(+)
> 

applied, but noted in the commit message that the side-effects from
parse_lxc_network cause the need for this. Thanks!

> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 2699d3d..7e51b8d 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -1211,6 +1211,7 @@ sub vmconfig_hotplug_pending {
>           } elsif ($opt =~ m/^net(\d+)$/) {
>               my $netid = $1;
>               my $net = $class->parse_lxc_network($value);
> +             $value = $class->print_lxc_network($net);
>               PVE::LXC::update_net($vmid, $conf, $opt, $net, $netid, 
> $rootdir);
>           } elsif ($opt eq 'memory' || $opt eq 'swap') {
>               if (!$hotplug_memory_done) { # don't call twice if both opts 
> are passed
> @@ -1297,6 +1298,10 @@ sub vmconfig_apply_pending {
>                           if !$class->is_volume_in_use($conf, $conf->{$opt}, 
> 1, 1);
>                   }
>               }
> +         } elsif ($opt =~ m/^net(\d+)$/) {
> +             my $netid = $1;
> +             my $net = $class->parse_lxc_network($conf->{pending}->{$opt});
> +             $conf->{pending}->{$opt} = $class->print_lxc_network($net);
>           }
>       };
>       if (my $err = $@) {
> 


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to