5
0
mirror of git://git.proxmox.com/git/pve-guest-common.git synced 2025-01-12 09:17:50 +03:00

Add new function delete_guest_states.

This commit is contained in:
Wolfgang Link 2017-06-27 12:20:23 +02:00 committed by Dietmar Maurer
parent fd844180a7
commit 14849765e5

View File

@ -147,6 +147,18 @@ sub record_job_start {
write_job_state($jobcfg, $state);
}
sub delete_guest_states {
my ($vmid) = @_;
my $code = sub {
my $stateobj = read_state();
delete $stateobj->{$vmid};
PVE::Tools::file_set_contents($state_path, encode_json($stateobj));
};
PVE::Tools::lock_file($state_lock, 10, $code);
}
sub record_job_end {
my ($jobcfg, $state, $start_time, $duration, $err) = @_;