From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 895281FF176 for ; Fri, 24 Jan 2025 11:08:36 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 54FC71C68B; Fri, 24 Jan 2025 11:08:19 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 24 Jan 2025 11:08:09 +0100 Message-Id: <20250124100811.32895-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250124100811.32895-1-f.ebner@proxmox.com> References: <20250124100811.32895-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.045 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, qemuserver.pm] Subject: [pve-devel] [PATCH qemu-server 1/3] backup: also restore VM power state for early failures 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" A failure during enforce_vm_running_for_backup() would result in restore_vm_power_state() not being called, but the VM might already have been started before the failure. In particular, this could happen in the context of bug #6007 [0], where the 'set_link' QMP command fails right after VM start. If the failure happens before successful start, there will be an additional error message issued by restore_vm_power_state() (that the VM is not running). This could be avoided by returning early if the VM is not running anymore, but that would mean not warning about it in other scenarios where it is not expected and keeping track of whether the VM was actually started or not does not seem to be worth it just for avoiding that error message in this edge case. [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=6007 Signed-off-by: Fiona Ebner --- PVE/VZDump/QemuServer.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index 44b68ae9..9d7c26a3 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -698,15 +698,15 @@ sub archive_pbs { # get list early so we die on unknown drive types before doing anything my $devlist = _get_task_devlist($task); - $self->enforce_vm_running_for_backup($vmid); - $self->{qmeventd_fh} = PVE::QemuServer::register_qmeventd_handle($vmid); - my $backup_job_uuid; eval { $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub { die "interrupted by signal\n"; }; + $self->enforce_vm_running_for_backup($vmid); + $self->{qmeventd_fh} = PVE::QemuServer::register_qmeventd_handle($vmid); + my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") }; my $err = $@; if (!$qemu_support || $err) { @@ -893,9 +893,6 @@ sub archive_vma { my $devlist = _get_task_devlist($task); - $self->enforce_vm_running_for_backup($vmid); - $self->{qmeventd_fh} = PVE::QemuServer::register_qmeventd_handle($vmid); - my $cpid; my $backup_job_uuid; @@ -904,6 +901,9 @@ sub archive_vma { die "interrupted by signal\n"; }; + $self->enforce_vm_running_for_backup($vmid); + $self->{qmeventd_fh} = PVE::QemuServer::register_qmeventd_handle($vmid); + # Currently, failing to determine Proxmox support is not critical here, because it's only # used for performance settings like 'max-workers'. my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") }; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel