[pve-devel] [PATCH v5 container 7/9] Config: add valid_volume_keys_with_unused

Aaron Lauterer a.lauterer at proxmox.com
Tue Nov 9 15:55:38 CET 2021


Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
v4 (follow up) -> v5: put this into its own patch

 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 8557e4c..8a25343 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1556,6 +1556,15 @@ sub valid_volume_keys {
     return $reverse ? reverse @names : @names;
 }
 
+sub valid_volume_keys_with_unused {
+    my ($class, $reverse) = @_;
+    my @names = $class->valid_volume_keys();
+    for (my $i = 0; $i < $MAX_UNUSED_DISKS; $i++) {
+	push @names, "unused$i";
+    }
+    return $reverse ? reverse @names : @names;
+}
+
 sub get_vm_volumes {
     my ($class, $conf, $excludes) = @_;
 
-- 
2.30.2





More information about the pve-devel mailing list