From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 2/2] config: print volume: support printing unused volume
Date: Thu, 3 Mar 2022 13:31:20 +0100 [thread overview]
Message-ID: <20220303123121.109758-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20220303123121.109758-1-f.ebner@proxmox.com>
In particular, fixes migration with an unused disk, where calling
update_volume_ids() failed previously.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
src/PVE/LXC/Config.pm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 0ed7bd2..d5b49d3 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1207,6 +1207,13 @@ sub print_ct_mountpoint {
return PVE::JSONSchema::print_property_string($info, $mp_desc, $skip);
}
+sub print_ct_unused {
+ my ($class, $info) = @_;
+
+ my $skip = [ 'type' ];
+ return PVE::JSONSchema::print_property_string($info, $unused_desc, $skip);
+}
+
sub parse_volume {
my ($class, $key, $volume_string, $noerr) = @_;
@@ -1228,6 +1235,8 @@ sub parse_volume {
sub print_volume {
my ($class, $key, $volume) = @_;
+ return $class->print_ct_unused($volume) if $key =~ m/^unused(\d+)$/;
+
return $class->print_ct_mountpoint($volume, $key eq 'rootfs');
}
--
2.30.2
next prev parent reply other threads:[~2022-03-03 12:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 12:31 [pve-devel] [PATCH-SERIES container/storage] migration fixes for containers Fabian Ebner
2022-03-03 12:31 ` [pve-devel] [PATCH container 1/2] migrate: also set targetsid for unreferenced disks Fabian Ebner
2022-03-03 12:31 ` Fabian Ebner [this message]
2022-03-03 12:31 ` [pve-devel] [PATCH storage 1/1] zfs: volume import: use correct format for renaming Fabian Ebner
2022-03-03 13:40 ` [pve-devel] applied series: [PATCH-SERIES container/storage] migration fixes for containers Wolfgang Bumiller
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=20220303123121.109758-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