From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 2/8] TestSupport: Use lv_dev_mapper in guest_find_lv Date: Tue, 6 Oct 2015 13:47:00 +0100 Message-ID: <1444135626-1771-2-git-send-email-ian.campbell@citrix.com> References: <1444135606.5302.145.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1444135606.5302.145.camel@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@eu.citrix.com, xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org This has the effect of switching $gho->{Lvdev} from /dev/$VG/$LV to /dev/mapper/$VG-$LV (where $VG and $LV have an s/-/--/ transformation applied). The two paths point to the samedevice and most call sites don't care about the distinction. Some places which use "kpartx $dev" to Lvdev expect to be able to append a partition number to $dev, while kpartx only creates the /dev/mapper form, meaning such places cannot use Lvdev. By making this switch we allow these places (such as ts-freebsd-install) to use kpartx. The only other place I'm aware of which requires one form or the other is the Debian initramfs code which expects root=/dev/mapper/vg-lv and does not accept /dev/vg/lv. However this is already handled correctly. Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v2: New(ish, posted in reply to v1) --- Osstest/TestSupport.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 09694f4..d8c5762 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1398,7 +1398,7 @@ sub guest_find_lv ($) { $gho->{Vg}= $r{"${gn}_vg"}; $gho->{Lv}= $r{"${gn}_disk_lv"}; $gho->{Lvdev}= (defined $gho->{Vg} && defined $gho->{Lv}) - ? '/dev/'.$gho->{Vg}.'/'.$gho->{Lv} : undef; + ? lv_dev_mapper($gho->{Vg},$gho->{Lv}) : undef; } sub guest_find_diskimg($) -- 2.5.3