From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D7DC01FF161 for ; Tue, 13 Aug 2024 15:30:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5EF242E6A; Tue, 13 Aug 2024 15:29:14 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 13 Aug 2024 15:28:19 +0200 Message-Id: <20240813132829.117460-16-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813132829.117460-1-f.ebner@proxmox.com> References: <20240813132829.117460-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH qemu-server v2 15/25] backup: move cleanup of fleecing images to cleanup method X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" TPM drives are already detached there and it's better to group these things together. Signed-off-by: Fiona Ebner --- No changes in v2. PVE/VZDump/QemuServer.pm | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index 012c9210..b2ced154 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -690,7 +690,6 @@ sub archive_pbs { # get list early so we die on unkown drive types before doing anything my $devlist = _get_task_devlist($task); - my $use_fleecing; $self->enforce_vm_running_for_backup($vmid); $self->{qmeventd_fh} = PVE::QemuServer::register_qmeventd_handle($vmid); @@ -721,7 +720,7 @@ sub archive_pbs { my $is_template = PVE::QemuConfig->is_template($self->{vmlist}->{$vmid}); - $use_fleecing = check_and_prepare_fleecing( + $task->{'use-fleecing'} = check_and_prepare_fleecing( $self, $vmid, $opts->{fleecing}, $task->{disks}, $is_template, $qemu_support); my $fs_frozen = $self->qga_fs_freeze($task, $vmid); @@ -735,7 +734,7 @@ sub archive_pbs { devlist => $devlist, 'config-file' => $conffile, }; - $params->{fleecing} = JSON::true if $use_fleecing; + $params->{fleecing} = JSON::true if $task->{'use-fleecing'}; if (defined(my $ns = $scfg->{namespace})) { $params->{'backup-ns'} = $ns; @@ -784,11 +783,6 @@ sub archive_pbs { } $self->restore_vm_power_state($vmid); - if ($use_fleecing) { - detach_fleecing_images($task->{disks}, $vmid); - cleanup_fleecing_images($self, $task->{disks}); - } - die $err if $err; } @@ -891,7 +885,6 @@ sub archive_vma { } my $devlist = _get_task_devlist($task); - my $use_fleecing; $self->enforce_vm_running_for_backup($vmid); $self->{qmeventd_fh} = PVE::QemuServer::register_qmeventd_handle($vmid); @@ -911,7 +904,7 @@ sub archive_vma { $attach_tpmstate_drive->($self, $task, $vmid); - $use_fleecing = check_and_prepare_fleecing( + $task->{'use-fleecing'} = check_and_prepare_fleecing( $self, $vmid, $opts->{fleecing}, $task->{disks}, $is_template, $qemu_support); my $outfh; @@ -942,7 +935,7 @@ sub archive_vma { devlist => $devlist }; $params->{'firewall-file'} = $firewall if -e $firewall; - $params->{fleecing} = JSON::true if $use_fleecing; + $params->{fleecing} = JSON::true if $task->{'use-fleecing'}; add_backup_performance_options($params, $opts->{performance}, $qemu_support); $qmpclient->queue_cmd($vmid, $backup_cb, 'backup', %$params); @@ -984,11 +977,6 @@ sub archive_vma { $self->restore_vm_power_state($vmid); - if ($use_fleecing) { - detach_fleecing_images($task->{disks}, $vmid); - cleanup_fleecing_images($self, $task->{disks}); - } - if ($err) { if ($cpid) { kill(9, $cpid); @@ -1132,6 +1120,11 @@ sub cleanup { $detach_tpmstate_drive->($task, $vmid); + if ($task->{'use-fleecing'}) { + detach_fleecing_images($task->{disks}, $vmid); + cleanup_fleecing_images($self, $task->{disks}); + } + if ($self->{qmeventd_fh}) { close($self->{qmeventd_fh}); } -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel