[pve-devel] [PATCH 3/9] add find_loopdev sub

Alexandre Derumier aderumier at odiso.com
Sun Aug 16 19:43:00 CEST 2015


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

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index fbdc5bb..10a89f2 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1800,4 +1800,11 @@ sub blockdevices_list {
     return $bdevs;
 }
 
+sub find_loopdev {
+    my ($loopdevs, $path) = @_;
+
+    foreach my $dev (keys %$loopdevs){
+	return $dev if $loopdevs->{$dev} eq $path;
+    }
+}
 1;
-- 
2.1.4




More information about the pve-devel mailing list