From 058fe7bc48af00043130e5fba3c592bb4b7064f2 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 8 Nov 2022 17:38:18 +0100 Subject: [PATCH] api: update cloudinit: line reduction/small cleanups Signed-off-by: Thomas Lamprecht --- PVE/API2/Qemu.pm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 659c3a09..20fd40af 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1402,24 +1402,17 @@ __PACKAGE__->register_method({ my ($param) = @_; my $rpcenv = PVE::RPCEnvironment::get(); - my $authuser = $rpcenv->get_user(); my $vmid = extract_param($param, 'vmid'); - my $updatefn = sub { - + PVE::QemuConfig->lock_config($vmid, sub { my $conf = PVE::QemuConfig->load_config($vmid); - PVE::QemuConfig->check_lock($conf); my $storecfg = PVE::Storage::config(); - PVE::QemuServer::vmconfig_update_cloudinit_drive($storecfg, $conf, $vmid); - }; - - PVE::QemuConfig->lock_config($vmid, $updatefn); - + }); return; }});