[pve-devel] [PATCH storage] Add comment for volume_has_feature

Fabian Ebner f.ebner at proxmox.com
Wed Apr 8 13:40:07 CEST 2020


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

Took the opportunity to document the whole function
instead of just the new valid_target_formats option.

 PVE/Storage.pm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 60b8310..48179b5 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -285,6 +285,21 @@ sub volume_snapshot_delete {
     }
 }
 
+# check if a volume or snapshot supports a given feature
+# $feature - one of:
+#            clone - linked clone is possible
+#            copy  - full clone is possible
+#            replicate - replication is possible
+#            snapshot - taking a snapshot is possible
+#            sparseinit - volume is sparsely initialized
+#            template - conversion to base image is possible
+# $snap - check if the feature is supported for a given snapshot
+# $running - if the guest owning the volume is running
+# $opts - hash with further options:
+#         valid_target_formats - list of formats for the target of a copy/clone
+#                                operation that the caller could work with. The
+#                                format of $volid is always considered valid and if
+#                                no list is specified, all formats are considered valid.
 sub volume_has_feature {
     my ($cfg, $feature, $volid, $snap, $running, $opts) = @_;
 
-- 
2.20.1





More information about the pve-devel mailing list