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
@ -313,7 +313,7 @@ __PACKAGE__->register_method ({
|
||||
if $numdisks < $mindisks->{$raidlevel};
|
||||
|
||||
my $worker = sub {
|
||||
lock_file('/run/lock/pve-diskmanage.lck', 10, sub {
|
||||
PVE::Diskmanage::locked_disk_action(sub {
|
||||
# create zpool with desired raidlevel
|
||||
|
||||
my $cmd = [$ZPOOL, 'create', '-o', "ashift=$ashift", $name];
|
||||
@ -347,10 +347,8 @@ __PACKAGE__->register_method ({
|
||||
PVE::API2::Storage::Config->create($storage_params);
|
||||
}
|
||||
});
|
||||
die $@ if $@;
|
||||
};
|
||||
|
||||
|
||||
return $rpcenv->fork_worker('zfscreate', $name, $user, $worker);
|
||||
}});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user