All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Cc: "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH OSSTEST 4/6] ts-freebsd-install: Use $gho->{Lvdev} instead of target_guest_lv_name
Date: Fri, 2 Oct 2015 10:36:55 +0100	[thread overview]
Message-ID: <1443778615.11707.66.camel@citrix.com> (raw)
In-Reply-To: <1443696323.11707.13.camel@citrix.com>

On Thu, 2015-10-01 at 11:45 +0100, Ian Campbell wrote:
> On Tue, 2015-09-29 at 10:44 +0100, Ian Campbell wrote:
> > prepareguest has already assigned this so we should use it instead of
> > replicating (perhaps wrongly since target_guest_lv_name and
> > target_choose_vg can behave differently if multiple vgs are present).
> 
> This is wrong in practice because
>     kpartx -a /dev/some-vg/some-device
> produces /dev/mapper/some--vg-some--device1 etc but not /dev/some-vg/some
> -device1.
> 
> The right fix probably involves lv_dev_mapper($gho-{Vg}, "$gho->{Lv}3")
> instead.
> 
> I'm in two minds about having guest_find_lv use lv_dev_mapper to populate
> $gho->{Lvdev} in the first place as an alternative fix though.

I decided I liked this route more. It's as yet untested other than "perl 
-c", but I have inserted the patch below before this one.

commit 9ba9a4f1d3fb7f01a1c76e9bff9f4b23187d855b
Author: Ian Campbell <ian.campbell@citrix.com>
Date:   Fri Oct 2 10:31:13 2015 +0100

    TestSupport: Use lv_dev_mapper in guest_find_lv
    
    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 <ian.campbell@citrix.com>

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index c55b847..1365ee5 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1382,7 +1382,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($)

  parent reply	other threads:[~2015-10-02  9:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29  9:44 [PATCH OSSTEST 0/6] Fixes for switching to Jessie as base OS for test hosts Ian Campbell
2015-09-29  9:44 ` [PATCH OSSTEST 1/6] Debian: Uninstall flash-kernel when creating our own boot.scr Ian Campbell
2015-09-29 14:05   ` Ian Jackson
2015-09-29  9:44 ` [PATCH OSSTEST 2/6] Debian: Search for kernel in /boot as well as / when making u-boot script Ian Campbell
2015-09-29 14:07   ` Ian Jackson
2015-09-29  9:44 ` [PATCH OSSTEST 3/6] Debian: uboot: Use di_vg_name() and lv_dev_mapper() for root= Ian Campbell
2015-09-29 14:08   ` Ian Jackson
2015-09-29 14:18     ` Ian Campbell
2015-09-29 15:04       ` Ian Jackson
2015-09-29  9:44 ` [PATCH OSSTEST 4/6] ts-freebsd-install: Use $gho->{Lvdev} instead of target_guest_lv_name Ian Campbell
2015-09-29 14:09   ` Ian Jackson
2015-09-30 14:48   ` Roger Pau Monné
2015-09-30 15:06     ` Ian Jackson
2015-10-01 10:45   ` Ian Campbell
2015-10-01 10:48     ` Ian Campbell
2015-10-02  9:36     ` Ian Campbell [this message]
2015-10-05 16:31       ` Ian Jackson
2015-09-29  9:44 ` [PATCH OSSTEST 5/6] TestSupport: Remove now unused target_guest_lv_name Ian Campbell
2015-09-29 14:10   ` Ian Jackson
2015-09-29  9:44 ` [PATCH OSSTEST 6/6] Switch to Debian 8.0 (jessie) as OS for test hosts Ian Campbell
2015-09-29 14:11   ` Ian Jackson
2015-09-29 10:27 ` [PATCH OSSTEST 0/6] Fixes for switching to Jessie as base " Ian Campbell
2015-09-29 14:12   ` Ian Jackson
2015-09-29 14:11 ` Ian Jackson
2015-09-30 14:30 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443778615.11707.66.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.