allows us to reuse this for clone, where we want to create a "clone"
locked config for the target guest.

Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---
 PVE/AbstractConfig.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm
index a94a379..b63a744 100644
--- a/PVE/AbstractConfig.pm
+++ b/PVE/AbstractConfig.pm
@@ -223,14 +223,14 @@ sub lock_config_full {
 }
 
 sub create_and_lock_config {
-    my ($class, $vmid, $allow_existing) = @_;
+    my ($class, $vmid, $allow_existing, $lock) = @_;
 
     $class->lock_config_full($vmid, 5, sub {
        PVE::Cluster::check_vmid_unused($vmid, $allow_existing);
 
        my $conf = eval { $class->load_config($vmid) } || {};
        $class->check_lock($conf);
-       $conf->{lock} = 'create';
+       $conf->{lock} = $lock // 'create';
        $class->write_config($vmid, $conf);
     });
 }
-- 
2.20.1


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

Reply via email to