From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 2/2] restore: add more informational messages
Date: Wed, 25 Nov 2020 15:07:50 +0100 [thread overview]
Message-ID: <20201125140750.2851534-2-f.gruenbichler@proxmox.com> (raw)
In-Reply-To: <20201125140750.2851534-1-f.gruenbichler@proxmox.com>
to provide context for warnings/output created by various sub-operations.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
src/PVE/API2/LXC.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index a263104..824da40 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -354,6 +354,7 @@ __PACKAGE__->register_method({
die "can't overwrite running container\n" if PVE::LXC::check_running($vmid);
if ($is_root && $archive ne '-') {
my $orig_conf;
+ print "recovering backed-up configuration from '$archive'\n";
($orig_conf, $orig_mp_param) = PVE::LXC::Create::recover_config($storage_cfg, $archive, $vmid);
$was_template = delete $orig_conf->{template};
# When we're root call 'restore_configuration' with restricted=0,
@@ -366,6 +367,7 @@ __PACKAGE__->register_method({
if ($storage_only_mode) {
if ($restore) {
if (!defined($orig_mp_param)) {
+ print "recovering backed-up configuration from '$archive'\n";
(undef, $orig_mp_param) = PVE::LXC::Create::recover_config($storage_cfg, $archive, $vmid);
}
$mp_param = $orig_mp_param;
@@ -414,9 +416,12 @@ __PACKAGE__->register_method({
eval {
my $rootdir = PVE::LXC::mount_all($vmid, $storage_cfg, $conf, 1);
$bwlimit = PVE::Storage::get_bandwidth_limit('restore', [keys %used_storages], $bwlimit);
+ print "restoring '$archive' now..\n"
+ if $restore && $archive ne '-';
PVE::LXC::Create::restore_archive($storage_cfg, $archive, $rootdir, $conf, $ignore_unpack_errors, $bwlimit);
if ($restore) {
+ print "merging backed-up and given configuration..\n";
PVE::LXC::Create::restore_configuration($vmid, $storage_cfg, $archive, $rootdir, $conf, !$is_root, $unique, $skip_fw_config_restore);
my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir);
$lxc_setup->template_fixup($conf);
--
2.20.1
next prev parent reply other threads:[~2020-11-25 14:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 14:07 [pve-devel] [PATCH container 1/2] restore: pass target vmid to config recovery Fabian Grünbichler
2020-11-25 14:07 ` Fabian Grünbichler [this message]
2021-01-26 17:53 ` [pve-devel] applied: [PATCH container 2/2] restore: add more informational messages Thomas Lamprecht
2021-01-26 17:52 ` [pve-devel] applied: [PATCH container 1/2] restore: pass target vmid to config recovery 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=20201125140750.2851534-2-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@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.