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] live-restore: add more logging
Date: Tue, 18 May 2021 17:13:44 +0200	[thread overview]
Message-ID: <20210518151344.11410-1-s.reiter@proxmox.com> (raw)

To bring it better in line with regular restore, also log the
repository, the snapshot and the target for each drive.

While at it, adjust capitalization of existing log line and clean up
repeated '$1' use.

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

As requested here:
https://forum.proxmox.com/threads/backup-image-name-in-live-restore-task-log.89363/

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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 638077c..773d060 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6416,17 +6416,23 @@ sub restore_proxmox_backup_archive {
 sub pbs_live_restore {
     my ($vmid, $conf, $storecfg, $restored_disks, $repo, $keyfile, $snap) = @_;
 
-    print "Starting VM for live-restore\n";
+    print "starting VM for live-restore\n";
+    print "repository: '$repo'\n";
+    print "snapshot: '$snap'\n";
 
     my $pbs_backing = {};
     for my $ds (keys %$restored_disks) {
 	$ds =~ m/^drive-(.*)$/;
-	$pbs_backing->{$1} = {
+	my $confname = $1;
+	$pbs_backing->{$confname} = {
 	    repository => $repo,
 	    snapshot => $snap,
 	    archive => "$ds.img.fidx",
 	};
-	$pbs_backing->{$1}->{keyfile} = $keyfile if -e $keyfile;
+	$pbs_backing->{$confname}->{keyfile} = $keyfile if -e $keyfile;
+
+	my $drive = parse_drive($confname, $conf->{$confname});
+	print "restoring '$ds' to '$drive->{file}'\n";
     }
 
     my $drives_streamed = 0;
-- 
2.20.1





             reply	other threads:[~2021-05-18 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 15:13 Stefan Reiter [this message]
2021-05-28 11:51 ` [pve-devel] applied: " 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=20210518151344.11410-1-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