all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v3 1/3] backup: also restore VM power state for early failures
Date: Wed, 12 Feb 2025 12:04:25 +0100	[thread overview]
Message-ID: <20250212110427.33757-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250212110427.33757-1-f.ebner@proxmox.com>

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 <f.ebner@proxmox.com>
---

No changes in v3.

 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


  reply	other threads:[~2025-02-12 11:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 11:04 [pve-devel] [PATCH-SERIES qemu-server v3 0/3] fix #6007: fix PBS template backup for certain configurations Fiona Ebner
2025-02-12 11:04 ` Fiona Ebner [this message]
2025-02-12 11:04 ` [pve-devel] [PATCH qemu-server v3 2/3] config: add special class that prevents writing the configuration Fiona Ebner
2025-02-18 11:03   ` Wolfgang Bumiller
2025-02-18 13:08     ` [pve-devel] [PATCH qemu-server 0/2] follow-ups for "v3 fix #6007: fix PBS template backup for certain configurations" Fabian Grünbichler
2025-02-18 13:08       ` [pve-devel] [PATCH qemu-server 1/2] config: revamp NoWrite interface Fabian Grünbichler
2025-02-18 13:08       ` [pve-devel] [PATCH qemu-server 2/2] config: make attempts at writing out NoWrite configs fatal Fabian Grünbichler
2025-02-18 13:18       ` [pve-devel] [PATCH qemu-server 0/2] follow-ups for "v3 fix #6007: fix PBS template backup for certain configurations" Fiona Ebner
2025-02-12 11:04 ` [pve-devel] [PATCH qemu-server v3 3/3] fix #6007: template backup: use minimized configuration for handling the full vm start Fiona Ebner
2025-02-18 14:20 ` [pve-devel] applied-series: [PATCH-SERIES qemu-server v3 0/3] fix #6007: fix PBS template backup for certain configurations Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250212110427.33757-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal