[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 3/6] TestSupport: break out lv_dev_mapper



Signed-off-by: Ian Jackson <ijackson@xxxxxxxxxxxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 3ff70a5..bfccaf1 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -61,7 +61,8 @@ BEGIN {
                       target_run_apt
                       target_install_packages target_install_packages_norec
                       target_jobdir target_extract_jobdistpath_subdir
-                      target_extract_jobdistpath target_guest_lv_name
+                      target_extract_jobdistpath
+                      lv_dev_mapper target_guest_lv_name
 
                       poll_loop tcpconnect await_tcp
                       contents_make_cpio file_simple_write_contents
@@ -694,13 +695,17 @@ sub poll_loop ($$$&) {
     logm("$what: ok. (${waited}s)");
 }
 
-sub target_guest_lv_name($$) {
-    my ($ho, $lv) = @_;
-
-    my $vg = "$ho->{Name}";
-    # Dashes are escaped in the VG name
+sub lv_dev_mapper ($$) {
+    my ($vg,$lv) = @_;
     $vg =~ s/-/--/g;
+    $lv =~ s/-/--/g;
+    # Dashes are doubled in the VG and LV names
     return "/dev/mapper/$vg-$lv";
+}    
+
+sub target_guest_lv_name($$) {
+    my ($ho, $lv) = @_;
+    return lv_dev_mapper("$ho->{Name}", $lv);
 }
 
 #---------- dhcp watching ----------
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.