[pve-devel] [PATCH pve-storage 1/3] plugin : add volume_blocksize_info

Alexandre Derumier aderumier at odiso.com
Fri Jun 29 16:40:11 CEST 2018


---
 PVE/Storage.pm        | 11 +++++++++++
 PVE/Storage/Plugin.pm |  5 +++++
 2 files changed, 16 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index d733380..70923cd 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -185,6 +185,17 @@ sub volume_size_info {
     }
 }
 
+sub volume_blocksize_info {
+    my ($cfg, $volid, $timeout) = @_;
+
+    my ($storeid, $volname) = parse_volume_id($volid, 1);
+    if ($storeid) {
+	my $scfg = storage_config($cfg, $storeid);
+	my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+	return $plugin->volume_blocksize_info($scfg, $storeid, $volname, $timeout);
+    }
+}
+
 sub volume_resize {
     my ($cfg, $volid, $size, $running) = @_;
 
diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 163871d..ec9b9a0 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -682,6 +682,11 @@ sub volume_size_info {
 
 }
 
+sub volume_blocksize_info {
+    my ($class, $scfg, $storeid, $volname, $timeout) = @_;
+    return undef;
+}
+
 sub volume_resize {
     my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
 
-- 
2.11.0




More information about the pve-devel mailing list