refactor diskmanagement lock_file calls
so that we only have one place where we reference the lockfile and the timeout Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
7058abe29e
commit
e39e8ee213
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user