]> git.proxmox.com Git - pve-storage.git/commitdiff
map_volume: fall back to 'path'
authorMira Limbeck <m.limbeck@proxmox.com>
Mon, 29 Apr 2019 13:00:38 +0000 (15:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 29 Apr 2019 13:44:40 +0000 (13:44 +0000)
Adds a fallback to 'Plugin::path' in the default implementation of
'map_volume' to simplify a common case of calling 'map_volume' followed
by a defined-check and a call to path if it is not. The path is now
always returned if the plugin in question does not override
'map_volume'.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
PVE/Storage/Plugin.pm

index 796444124b43c5fbc0b41ff59c6a4043ce002b6c..cca0ed862c835d70842aa627ea2a8e3f100bdc7d 100644 (file)
@@ -966,7 +966,8 @@ sub deactivate_storage {
 sub map_volume {
     my ($class, $storeid, $scfg, $volname, $snapname) = @_;
 
 sub map_volume {
     my ($class, $storeid, $scfg, $volname, $snapname) = @_;
 
-    return undef;
+    my ($path) = $class->path($scfg, $volname, $storeid, $snapname);
+    return $path;
 }
 
 sub unmap_volume {
 }
 
 sub unmap_volume {