public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 3/4] Log storage_migrate output
Date: Wed, 29 Jul 2020 11:44:17 +0200	[thread overview]
Message-ID: <20200729094418.20523-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20200729094418.20523-1-f.ebner@proxmox.com>

and make it more clear where an error within storage_migrate came from.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index e482657..90d74b4 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -292,7 +292,14 @@ sub phase1 {
 	    'with_snapshots' => $volhash->{$volid}->{snapshots},
 	};
 
-	PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, $storage_migrate_opts);
+	my $logfunc = sub { $self->log('info', $_[0]); };
+	eval {
+	    PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info},
+					  $sid, $storage_migrate_opts, $logfunc);
+	};
+	if (my $err = $@) {
+	    die "storage migration for '$volid' to storage '$sid' failed - $err\n";
+	}
     }
 
     my $conffile = PVE::LXC::Config->config_file($vmid);
-- 
2.20.1





  parent reply	other threads:[~2020-07-29  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29  9:44 [pve-devel] [PATCH qemu-server 1/4] Use correct option for storage_migrate Fabian Ebner
2020-07-29  9:44 ` [pve-devel] [PATCH container 2/4] " Fabian Ebner
2020-07-29  9:44 ` Fabian Ebner [this message]
2020-07-29  9:44 ` [pve-devel] [PATCH storage 4/4] storage_migrate: log bandwidth limit Fabian Ebner
2020-08-04 12:08 ` [pve-devel] applied: [PATCH qemu-server 1/4] Use correct option for storage_migrate 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=20200729094418.20523-3-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 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