All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	ian.jackson@eu.citrix.com
Subject: Re: [PATCH OSSTEST v3 06/11] Cope with Jessie's d-i vg name
Date: Wed, 17 Jun 2015 16:05:07 +0100	[thread overview]
Message-ID: <20150617150507.GB28194@zion.uk.xensource.com> (raw)
In-Reply-To: <20150617144257.GA28194@zion.uk.xensource.com>

On Wed, Jun 17, 2015 at 03:42:57PM +0100, Wei Liu wrote:
> On Wed, Jun 17, 2015 at 03:22:09PM +0100, Ian Campbell wrote:
> > On Wed, 2015-06-17 at 14:06 +0100, Wei Liu wrote:
> > > In Jessie the default vg name is changed to "$hostname-vg". Make that
> > > default case and check for wheezy, squeeze and lenny for backward
> > > compatibility.
> > > 
> > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > ---
> > > Changes in v3:
> > > 1. Introduce a function to return vg name and use it.
> > 
> > Testing on ARM64 I get:
> > Undefined subroutine &main::di_vg_name called at ./ts-xen-build-prep line 55.
> > 
> > I'm pretty certain this isn't to do with my arm4 patches.
> > 
> > I suspect adding "use Debian" to ts-xen-build-prep will fix it, I'm not
> > sure if there is a reason it doesn't do so already. Given that it has a
> > bunch of Debian-ish stuff in it I see no reason to avoid it...
> > 
> 
> Yes, use Osstest::Debian; should fix that.
> 

The following patch contains the fix.

---8<---
>From 65b37ee4ecbe117969ac3df28122c934c3088dcf Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@citrix.com>
Date: Mon, 15 Jun 2015 12:07:38 +0100
Subject: [PATCH OSSTEST] Cope with Jessie's d-i vg name
Cc: ian.campbell@citrix.com, ian.jackson@eu.citrix.com

In Jessie the default vg name is changed to "$hostname-vg". Make that
default case and check for wheezy, squeeze and lenny for backward
compatibility.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Changes in v4:
1. Add missing "use Osstest::Debian;".

Changes in v3:
1. Introduce a function to return vg name and use it.

Changes in v2:
1. Make Jessie case default.
---
 Osstest/Debian.pm | 13 +++++++++++++
 ts-host-install   |  3 +--
 ts-xen-build-prep |  6 ++----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 8ad673e..b1a5396 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -43,6 +43,7 @@ BEGIN {
                       preseed_hook_overlay
                       preseed_hook_cmds
                       di_installcmdline_core
+                      di_vg_name
                       );
     %EXPORT_TAGS = ( );
 
@@ -566,6 +567,18 @@ sub di_installcmdline_core ($$;@) {
     return @cl;
 }
 
+sub di_vg_name($) {
+    my ($ho) = @_;
+
+    if ($ho->{Suite} =~ m/wheezy|squeeze/) {
+	return $ho->{Name};
+    }
+    if ($ho->{Suite} =~ m/lenny/){
+	return "$ho->{Name}.$c{TestHostDomain}";
+    }
+    return "$ho->{Name}-vg";
+}
+
 sub preseed_ssh ($$) {
     my ($ho,$sfx) = @_;
 
diff --git a/ts-host-install b/ts-host-install
index 242bfb0..04d5487 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -87,10 +87,9 @@ END
 
     await_tcp(get_timeout($ho,'reboot',$timeout{Sshd}), 14,$ho);
 
-    our $vgname= $ho->{Name};
+    our $vgname = di_vg_name($ho);
 
     if ($ho->{Suite} =~ m/lenny/) {
-        $vgname .= ".$c{TestHostDomain}";
         target_editfile_root($ho, '/boot/grub/menu.lst', sub {
             while (<EI>) {
                 s/^terminal.*/terminal --timeout=10 serial console/;
diff --git a/ts-xen-build-prep b/ts-xen-build-prep
index 4dece65..b5d7ed0 100755
--- a/ts-xen-build-prep
+++ b/ts-xen-build-prep
@@ -20,6 +20,7 @@ use DBI;
 use Osstest;
 use POSIX;
 use Osstest::TestSupport;
+use Osstest::Debian;
 
 tsreadconfig();
 
@@ -52,10 +53,7 @@ sub overall_limit_pe ($) {
 }
 
 sub determine_vg_lv () {
-    $vg=
-        $ho->{Suite} =~ m/lenny/
-        ? "$ho->{Name}.$c{TestHostDomain}"
-        : $ho->{Name};
+    $vg = di_vg_name($ho);
     $lv = "/dev/$vg/$lvleaf";
 }
 
-- 
1.9.1

  reply	other threads:[~2015-06-17 15:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 13:06 [PATCH OSSTEST v3 00/11] Upgrade to Jessie Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 01/11] More flexible handling of need-kernel-deb-$flavour host flag Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 02/11] mg-debian-installer-update: updates to better handle Jessie onwards Wei Liu
2015-06-19 12:33   ` Ian Jackson
2015-06-19 13:50   ` Ian Campbell
2015-06-19 14:53     ` Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 03/11] mg-debian-installer-update: Also collect DTBs for standard kernels Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 04/11] Force sysvinit with Jessie Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 05/11] Debian.pm: install grub to default device Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 06/11] Cope with Jessie's d-i vg name Wei Liu
2015-06-17 14:22   ` Ian Campbell
2015-06-17 14:42     ` Wei Liu
2015-06-17 15:05       ` Wei Liu [this message]
2015-06-19 12:21   ` Ian Jackson
2015-06-17 13:06 ` [PATCH OSSTEST v3 07/11] Debian: grub2: Allow submenu and menuentry items to be indented Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 08/11] ts-xen-build-prep: install libnl-route-3-dev on Jessie Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 09/11] ts-xen-build-prep: reverse the test for installing libc6-dev-i386 Wei Liu
2015-06-19 12:22   ` Ian Jackson
2015-06-17 13:06 ` [PATCH OSSTEST v3 10/11] ts-xen-install: install libnl-route-3-200 for jessie Wei Liu
2015-06-17 13:06 ` [PATCH OSSTEST v3 11/11] ts-kernel-build: enable CONFIG_FHANDLE Wei Liu
2015-06-18 16:27 ` [PATCH OSSTEST v3 12/11] toolstack/libvirt: install libnl-3-200 on Jessie Wei Liu
2015-06-19 12:05   ` Ian Jackson
2015-06-19 16:13     ` Wei Liu

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=20150617150507.GB28194@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.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.