[pve-devel] [PATCH] moved from PVE::Storage:NFSPlugin to reuse the code

Wolfgang Link w.link at proxmox.com
Thu Sep 3 08:51:47 CEST 2015


---
 src/PVE/Tools.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 577a8bc..4f7efd1 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -39,6 +39,7 @@ template_replace
 safe_print
 trim
 extract_param
+read_proc_mounts
 );
 
 my $pvelogdir = "/var/log/pve";
@@ -1116,4 +1117,17 @@ sub parse_host_and_port {
     return; # nothing
 }
 
+sub read_proc_mounts {
+
+    local $/; # enable slurp mode
+
+    my $data = "";
+    if (my $fd = IO::File->new("/proc/mounts", "r")) {
+	$data = <$fd>;
+	close ($fd);
+    }
+
+    return $data;
+}
+
 1;
-- 
2.1.4





More information about the pve-devel mailing list