From: Ian Campbell Subject: Re: [PATCH 3/6] TestSupport: break out lv_dev_mapper Date: Thu, 12 Jun 2014 09:27:56 +0100 Message-ID: <1402561676.4342.6.camel@kazak.uk.xensource.com> References: <1402519665-17578-1-git-send-email-ian.jackson@eu.citrix.com> <1402519665-17578-3-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wv0Mb-0003tP-7z for xen-devel@lists.xenproject.org; Thu, 12 Jun 2014 08:28:01 +0000 In-Reply-To: <1402519665-17578-3-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: Ian Jackson Cc: xen-devel@lists.xenproject.org, Ian Jackson List-Id: xen-devel@lists.xenproject.org On Wed, 2014-06-11 at 21:47 +0100, Ian Jackson wrote: > 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 Doesn't this belong before the two substitutions? > return "/dev/mapper/$vg-$lv"; > +} > + > +sub target_guest_lv_name($$) { > + my ($ho, $lv) = @_; > + return lv_dev_mapper("$ho->{Name}", $lv); > } > > #---------- dhcp watching ----------