mirror of
https://git.proxmox.com/git/pve-guest-common
synced 2025-08-03 09:56:18 +00:00
base guest config: add common destroy_config implementation
copied over from pve-containers implementation with the same name. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
8c3af92574
commit
1aa76f2f0b
@ -95,6 +95,15 @@ sub create_and_lock_config {
|
||||
});
|
||||
}
|
||||
|
||||
# destroys configuration, only applyable for configs owned by the callers node.
|
||||
# dies if removal fails, e.g., when inquorate.
|
||||
sub destroy_config {
|
||||
my ($class, $vmid) = @_;
|
||||
|
||||
my $config_fn = $class->config_file($vmid, $nodename);
|
||||
unlink $config_fn or die "failed to remove config file: $!\n";
|
||||
}
|
||||
|
||||
# Lock config file using flock, run $code with @param, unlock config file.
|
||||
# $timeout is the maximum time to aquire the flock
|
||||
# $shared eq 1 creates a non-exclusive ("read") flock
|
||||
|
Loading…
Reference in New Issue
Block a user