X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2FPVE%2FLXC%2FConfig.pm;h=3156b6cbca5eb895a6fd64eb95720464a5431596;hb=70996986bb93f4fbb467bb9be5bcfe5bb6e4511d;hp=5dc24b32fde9c4e7cc2b99a20af849ac8720fddb;hpb=f78c87a8d524c5cb3643104622cb959b8c272e45;p=pve-container.git diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 5dc24b3..3156b6c 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -390,7 +390,6 @@ my $confdesc = { type => 'integer', minimum => 0, }, - replicate => get_standard_option('pve-replicate'), cmode => { optional => 1, description => "Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).", @@ -832,8 +831,6 @@ sub update_pct_config { } } elsif ($opt eq 'unprivileged') { die "unable to delete read-only option: '$opt'\n"; - } elsif ($opt eq "replicate") { - delete $conf->{$opt}; } else { die "implement me (delete: $opt)" } @@ -972,15 +969,10 @@ sub update_pct_config { } elsif ($opt eq 'ostype') { next if $hotplug_error->($opt); $conf->{$opt} = $value; - } elsif ($opt eq "replicate") { - # check replicate feature on all mountpoints - PVE::LXC::Config->get_replicatable_volumes($storecfg, $conf); - my $repl = PVE::JSONSchema::check_format('pve-replicate', $value); - PVE::Cluster::check_node_exists($repl->{target}); - $conf->{$opt} = $value; } else { die "implement me: $opt"; } + PVE::LXC::Config->write_config($vmid, $conf) if $running; } @@ -1255,7 +1247,7 @@ sub get_vm_volumes { } sub get_replicatable_volumes { - my ($class, $storecfg, $conf, $noerr) = @_; + my ($class, $storecfg, $vmid, $conf, $cleanup, $noerr) = @_; my $volhash = {}; @@ -1264,10 +1256,10 @@ sub get_replicatable_volumes { return if !$volid; - return if defined($mountpoint->{replicate}) && !$mountpoint->{replicate}; + return if !$cleanup && defined($mountpoint->{replicate}) && !$mountpoint->{replicate}; if (!PVE::Storage::volume_has_feature($storecfg, 'replicate', $volid)) { - return if $noerr; + return if $cleanup || $noerr; die "missing replicate feature on volume '$volid'\n"; }