]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
TestSupport: break out lv_dev_mapper
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 11 Jun 2014 17:28:55 +0000 (18:28 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 18 May 2015 14:53:42 +0000 (15:53 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Osstest/TestSupport.pm

index d4440221b060039fe34999fa6dacdffb6d70711e..abb319509e401cccc06f6da32f79cd10b1172244 100644 (file)
@@ -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 ----------