]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Diskmanage.pm
refactor diskmanagement lock_file calls
[pve-storage.git] / PVE / Diskmanage.pm
index 23e5b13ecce0a1d1bd2104ebf26973f0f9822288..1938fa8ff52516f442e8a68c4cb5f73771d1270a 100644 (file)
@@ -595,4 +595,11 @@ sub get_blockdev {
     return $block_dev;
 }
 
+sub locked_disk_action {
+    my ($sub) = @_;
+    my $res = PVE::Tools::lock_file('/run/lock/pve-diskmanage.lck', undef, $sub);
+    die $@ if $@;
+    return $res;
+}
+
 1;