[pve-devel] [PATCH container 2/2] config: print volume: support printing unused volume

Fabian Ebner f.ebner at proxmox.com
Thu Mar 3 13:31:20 CET 2022


In particular, fixes migration with an unused disk, where calling
update_volume_ids() failed previously.

Signed-off-by: Fabian Ebner <f.ebner at 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






More information about the pve-devel mailing list