public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 2/3] live-restore: don't remove VM on error
Date: Wed, 21 Apr 2021 16:25:24 +0200	[thread overview]
Message-ID: <20210421142525.2159-2-s.reiter@proxmox.com> (raw)
In-Reply-To: <20210421142525.2159-1-s.reiter@proxmox.com>

Potentially an admin can still recover some data, or wants to inspect
the state.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---

The message printed in the task log already suggest as much.

 PVE/QemuServer.pm | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index fec2edb..d042a7e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6386,28 +6386,17 @@ sub restore_proxmox_backup_archive {
     PVE::AccessControl::add_vm_to_pool($vmid, $options->{pool}) if $options->{pool};
 
     if ($options->{live}) {
-	eval {
-	    # enable interrupts
-	    local $SIG{INT} =
-		local $SIG{TERM} =
-		local $SIG{QUIT} =
-		local $SIG{HUP} =
-		local $SIG{PIPE} = sub { die "got signal ($!) - abort\n"; };
+	# enable interrupts
+	local $SIG{INT} =
+	    local $SIG{TERM} =
+	    local $SIG{QUIT} =
+	    local $SIG{HUP} =
+	    local $SIG{PIPE} = sub { die "got signal ($!) - abort\n"; };
 
-	    my $conf = PVE::QemuConfig->load_config($vmid);
-	    die "cannot do live-restore for template\n" if PVE::QemuConfig->is_template($conf);
+	my $conf = PVE::QemuConfig->load_config($vmid);
+	die "cannot do live-restore for template\n" if PVE::QemuConfig->is_template($conf);
 
-	    pbs_live_restore($vmid, $conf, $storecfg, $devinfo, $repo, $keyfile, $pbs_backup_name);
-	};
-
-	$err = $@;
-	if ($err) {
-	    warn "destroying partially live-restored VM, all temporary data will be lost!\n";
-	    $restore_deactivate_volumes->($storecfg, $devinfo);
-	    $restore_destroy_volumes->($storecfg, $devinfo);
-	    PVE::QemuConfig->destroy_config($vmid);
-	    die $err;
-	}
+	pbs_live_restore($vmid, $conf, $storecfg, $devinfo, $repo, $keyfile, $pbs_backup_name);
     }
 }
 
-- 
2.20.1





  reply	other threads:[~2021-04-21 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 14:25 [pve-devel] [PATCH qemu-server 1/3] qmrestore: add live-restore option Stefan Reiter
2021-04-21 14:25 ` Stefan Reiter [this message]
2021-04-21 14:25 ` [pve-devel] [PATCH qemu-server 3/3] live-restore: hold 'create' lock during operation Stefan Reiter
2021-04-21 15:56 ` [pve-devel] applied-series: [PATCH qemu-server 1/3] qmrestore: add live-restore option Thomas Lamprecht

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=20210421142525.2159-2-s.reiter@proxmox.com \
    --to=s.reiter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal