From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [PATCH 3/6] TestSupport: break out lv_dev_mapper Date: Wed, 11 Jun 2014 21:47:42 +0100 Message-ID: <1402519665-17578-3-git-send-email-ian.jackson@eu.citrix.com> References: <1402519665-17578-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WupRH-0000Bm-BL for xen-devel@lists.xenproject.org; Wed, 11 Jun 2014 20:48:07 +0000 In-Reply-To: <1402519665-17578-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Campbell , Ian Jackson , Ian Jackson List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 93c8fcf..593f06c 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -59,7 +59,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 @@ -639,13 +640,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