[pve-devel] [PATCH] storage: add parse_volname

Alexandre Derumier aderumier at odiso.com
Wed Sep 25 10:26:54 CEST 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage.pm |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 3d01e37..b38990a 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -259,6 +259,17 @@ sub parse_vmid {
     return int($vmid);
 }
 
+sub parse_volname {
+    my ($cfg, $volid) = @_;
+
+    my ($storeid, $volname) = parse_volume_id($volid);
+
+    my $scfg = storage_config($cfg, $storeid);
+
+    my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+    return $plugin->parse_volname($volname);
+}
+
 sub parse_volume_id {
     my ($volid, $noerr) = @_;
 
-- 
1.7.10.4



More information about the pve-devel mailing list