[pve-devel] [PATCH container 2/3] config: parse_volume: don't die when noerr is set

Fabian Ebner f.ebner at proxmox.com
Thu Aug 5 09:19:57 CEST 2021


AFAICT, the only existing callers using noerr=1 are in
__snapshot_delete_remove_drive, and in AbstractConfig's
foreach_volume_full, and they both should be fine with the change.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Required for the next patch.

 src/PVE/LXC/Config.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index f832f90..7a1f72d 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1186,7 +1186,9 @@ sub parse_volume {
 	return $parse_ct_mountpoint_full->($class, $unused_desc, $volume_string, $noerr);
     }
 
-    die "parse_volume - unknown type: $key\n";
+    die "parse_volume - unknown type: $key\n" if !$noerr;
+
+    return;
 }
 
 sub print_volume {
-- 
2.30.2






More information about the pve-devel mailing list