mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 19:20:11 +00:00
backup: cleanup: check if VM is running before issuing QMP commands
When the VM is only started for backup, the VM will be stopped at that point again. While the detach helpers do not warn about errors currently, that might change in the future. This is also in preparation for other cleanup QMP helpers that are more verbose about failure. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
f270ebb198
commit
a5f16bec8e
@ -1118,13 +1118,14 @@ sub snapshot {
|
|||||||
sub cleanup {
|
sub cleanup {
|
||||||
my ($self, $task, $vmid) = @_;
|
my ($self, $task, $vmid) = @_;
|
||||||
|
|
||||||
$detach_tpmstate_drive->($task, $vmid);
|
# If VM was started only for backup, it is already stopped now.
|
||||||
|
if (PVE::QemuServer::Helpers::vm_running_locally($vmid)) {
|
||||||
if ($task->{'use-fleecing'}) {
|
$detach_tpmstate_drive->($task, $vmid);
|
||||||
detach_fleecing_images($task->{disks}, $vmid);
|
detach_fleecing_images($task->{disks}, $vmid) if $task->{'use-fleecing'};
|
||||||
cleanup_fleecing_images($self, $task->{disks});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup_fleecing_images($self, $task->{disks}) if $task->{'use-fleecing'};
|
||||||
|
|
||||||
if ($self->{qmeventd_fh}) {
|
if ($self->{qmeventd_fh}) {
|
||||||
close($self->{qmeventd_fh});
|
close($self->{qmeventd_fh});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user