Re: [Xen-devel] [OSSTEST PATCH 2/4] Build XEN and HVM Dom0 kernel for L1 guest VM

2015-01-28 Thread Hu, Robert
> -Original Message-
> From: Ian Campbell [mailto:ian.campb...@citrix.com]
> Sent: Tuesday, January 27, 2015 7:01 PM
> To: Hu, Robert
> Cc: Wei Liu; Pang, LongtaoX; xen-devel@lists.xen.org;
> ian.jack...@eu.citrix.com; Zheng, Di
> Subject: Re: [OSSTEST PATCH 2/4] Build XEN and HVM Dom0 kernel for L1 guest
> VM
> 
> On Tue, 2015-01-27 at 08:33 +, Hu, Robert wrote:
> [...] please trim quotes.
> > >
> > > FWIW, OSSTest has a bunch of overlay files (look at overlay directory),
> > > which includes an init script called xenbridge. In theory if you're
> > > reusing this script (ts-xen-install) then you don't need to worry about
> > > setting up bridge?
> > I tried this approach, using xenbridge init scripts, it can work.
> > However, in original xen install, it seems not used. I don't see 'xenbridge'
> > in /etc/rc2.d/
> 
> xenbridge is only enabled if OldSeparateBridgeInitd is set, which it is
> not for a modern Xen install so I think this is a red-herring.
> 
> > Shall I know the xenbr0 is created? I think not by xenbridge init service.
> 
> The host networking is configured by the function nodhcp in
> ts-xen-install.
yeah, I get it now. Thanks.
> 
> Per our previous conversations once the L1 guest is installed you can
> mostly treat it as a if it were an L0 host wrt configuring it. In other
> words there should be no need for a separate setup_l1_bridge function,
> just some minor modifications to ts-xen-install.
I'll reuse this nodhcp() subroutine, rather than my setup_l1_bridge() nor 
xenbridge init script.
> 
> Ian.
> 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 2/4] Build XEN and HVM Dom0 kernel for L1 guest VM

2015-01-27 Thread Ian Campbell
On Tue, 2015-01-27 at 08:33 +, Hu, Robert wrote:
[...] please trim quotes.
> > 
> > FWIW, OSSTest has a bunch of overlay files (look at overlay directory),
> > which includes an init script called xenbridge. In theory if you're
> > reusing this script (ts-xen-install) then you don't need to worry about
> > setting up bridge?
> I tried this approach, using xenbridge init scripts, it can work.
> However, in original xen install, it seems not used. I don't see 'xenbridge'
> in /etc/rc2.d/

xenbridge is only enabled if OldSeparateBridgeInitd is set, which it is
not for a modern Xen install so I think this is a red-herring.

> Shall I know the xenbr0 is created? I think not by xenbridge init service.

The host networking is configured by the function nodhcp in
ts-xen-install.

Per our previous conversations once the L1 guest is installed you can
mostly treat it as a if it were an L0 host wrt configuring it. In other
words there should be no need for a separate setup_l1_bridge function,
just some minor modifications to ts-xen-install.

Ian.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 2/4] Build XEN and HVM Dom0 kernel for L1 guest VM

2015-01-27 Thread Hu, Robert

> -Original Message-
> From: Wei Liu [mailto:wei.l...@citrix.com]
> Sent: Thursday, December 11, 2014 7:25 PM
> To: Pang, LongtaoX
> Cc: xen-devel@lists.xen.org; ian.jack...@eu.citrix.com;
> ian.campb...@citrix.com; wei.l...@citrix.com; Hu, Robert; Zheng, Di
> Subject: Re: [OSSTEST PATCH 2/4] Build XEN and HVM Dom0 kernel for L1 guest
> VM
> 
> On Wed, Dec 10, 2014 at 04:07:38PM +0800, longtao.pang wrote:
> > From: "longtao.pang" 
> >
> > This patch is used for building XEN and HVM Dom0 kernel for L1 guest VM,
> > and then reboot L1 guest into xen kernel.
> >
> 
> I think you can just use the L0 Xen and Dom0 kernel, that would save you
> lots of time running this test case. It can also help simplifies this
> patch, maybe?
> 
> > ---
> >  sg-run-job |1 +
> >  ts-xen-install |  149
> +---
> >  2 files changed, 111 insertions(+), 39 deletions(-)
> >
> > diff --git a/sg-run-job b/sg-run-job
> > index 8dcf7af..e513bd1 100755
> > --- a/sg-run-job
> > +++ b/sg-run-job
> > @@ -291,6 +291,7 @@ proc run-job/test-pair {} {
> >  proc need-hosts/test-nested {} {return host}
> >  proc run-job/test-nested {} {
> >  run-ts . = ts-debian-hvm-install + host + nested + nested_L1
> > +run-ts . = ts-xen-install + host + nested + nested_build
> >  }
> >
> >  proc test-guest-migr {g} {
> > diff --git a/ts-xen-install b/ts-xen-install
> > index 4d34d1f..c175d6d 100755
> > --- a/ts-xen-install
> > +++ b/ts-xen-install
> > @@ -28,19 +28,25 @@ use Osstest::CXFabric;
> >  my $checkmode= 0;
> >
> >  tsreadconfig();
> > -
> > +our $w_ho;
> >  our @hos;
> > -
> > -if (@ARGV and $ARGV[0] eq '--check') {
> > -$checkmode= 1;
> > -shift @ARGV;
> > -logm("checking builds are done...");
> > +our ($whhost,$gn,$nested_build) = @ARGV;
> > +$nested_build ||= '';
> > +if ($nested_build eq 'nested_build') {
> > +$whhost ||= 'host';
> > +$gn ||= 'nested';
> >  } else {
> > -if (!@ARGV) {
> > -   push @ARGV, 'host';
> > -}
> > -foreach my $k (@ARGV) {
> > -push @hos, selecthost($k);
> > +if (@ARGV and $ARGV[0] eq '--check') {
> > +$checkmode= 1;
> > +shift @ARGV;
> > +logm("checking builds are done...");
> > +} else {
> > +if (!@ARGV) {
> > +push @ARGV, 'host';
> > +}
> > +foreach my $k (@ARGV) {
> > +push @hos, selecthost($k);
> > +}
> >  }
> >  }
> >
> > @@ -49,18 +55,18 @@ our $ho;
> >  my %distpath;
> >
> >  sub packages () {
> > -target_install_packages($ho,
> > +target_install_packages($w_ho,
> >  qw(bridge-utils vncsnapshot libaio1
> libpixman-1-0
> > libsdl1.2debian libglib2.0-0
> liblzma5));
> > -target_install_packages($ho,
> > +target_install_packages($w_ho,
> > $ho->{Suite} =~ /squeeze/ ? "libyajl1" : 
> > "libyajl2");
> >  if ($ho->{Suite} !~ m/lenny|squeeze/) {
> > -target_install_packages($ho, 'libfdt1');
> > +target_install_packages($w_ho, 'libfdt1');
> >  }
> >  if ($r{arch} eq 'i386') {
> > -   target_install_packages($ho, 'libc6-xen');
> > +   target_install_packages($w_ho, 'libc6-xen');
> >  }
> > -target_install_packages($ho, @{toolstack()->{ExtraPackages}})
> > +target_install_packages($w_ho, @{toolstack()->{ExtraPackages}})
> >  if toolstack()->{ExtraPackages};
> >  }
> >
> > @@ -69,14 +75,14 @@ sub extract () {
> >  push @parts, 'libvirt' if $r{toolstack} eq "libvirt";
> >
> >  foreach my $part (@parts) {
> > -target_extract_jobdistpath($ho, $part, "path_${part}dist",
> > +target_extract_jobdistpath($w_ho, $part, "path_${part}dist",
> >$r{"${part}buildjob"}, \%distpath);
> >  }
> > -target_cmd_root($ho, '/sbin/ldconfig');
> > +target_cmd_root($w_ho, '/sbin/ldconfig');
> >  }
> >
> >  sub adjustconfig () {
> > -target_editfile_root($ho, "/etc/xen/xend-config.sxp",
> > +target_editfile_root($w_ho, "/etc/xen/xend-config.sxp",
> >  "xend-config.sxp", sub {
> > my (@domains) = (qw(localhost localhost.localdomain),
> >  ".".$c{DnsDomain}, ".".$c{TestHostDomain});
> > @@ -108,13 +114,13 @@ sub adjustconfig () {
> >  /etc/sysconfig/xencommons
> >  /etc/default/xend
> >  /etc/sysconfig/xend)) {
> > -next unless target_file_exists($ho, $try);
> > +next unless target_file_exists($w_ho, $try);
> >  $trace_config_file= $try;
> >  last;
> >  }
> >  die unless defined $trace_config_file;
> >
> > -target_editfile_root($ho, $trace_config_file, sub {
> > +target_editfile_root($w_ho, $trace_config_file, sub {
> >  my $prnow;
> >  $prnow= sub {
> >  print EO "XENCONSOLED_TRACE=guest\n" or die $!;
> > @@ -128,7 +134,7 @@ sub adjustcon

Re: [Xen-devel] [OSSTEST PATCH 2/4] Build XEN and HVM Dom0 kernel for L1 guest VM

2014-12-11 Thread Wei Liu
On Wed, Dec 10, 2014 at 04:07:38PM +0800, longtao.pang wrote:
> From: "longtao.pang" 
> 
> This patch is used for building XEN and HVM Dom0 kernel for L1 guest VM,
> and then reboot L1 guest into xen kernel.
> 

I think you can just use the L0 Xen and Dom0 kernel, that would save you
lots of time running this test case. It can also help simplifies this
patch, maybe?

> ---
>  sg-run-job |1 +
>  ts-xen-install |  149 
> +---
>  2 files changed, 111 insertions(+), 39 deletions(-)
> 
> diff --git a/sg-run-job b/sg-run-job
> index 8dcf7af..e513bd1 100755
> --- a/sg-run-job
> +++ b/sg-run-job
> @@ -291,6 +291,7 @@ proc run-job/test-pair {} {
>  proc need-hosts/test-nested {} {return host}
>  proc run-job/test-nested {} {
>  run-ts . = ts-debian-hvm-install + host + nested + nested_L1
> +run-ts . = ts-xen-install + host + nested + nested_build
>  }
>  
>  proc test-guest-migr {g} {
> diff --git a/ts-xen-install b/ts-xen-install
> index 4d34d1f..c175d6d 100755
> --- a/ts-xen-install
> +++ b/ts-xen-install
> @@ -28,19 +28,25 @@ use Osstest::CXFabric;
>  my $checkmode= 0;
>  
>  tsreadconfig();
> -
> +our $w_ho;
>  our @hos;
> -
> -if (@ARGV and $ARGV[0] eq '--check') {
> -$checkmode= 1;
> -shift @ARGV;
> -logm("checking builds are done...");
> +our ($whhost,$gn,$nested_build) = @ARGV;
> +$nested_build ||= '';
> +if ($nested_build eq 'nested_build') {
> +$whhost ||= 'host';
> +$gn ||= 'nested';
>  } else {
> -if (!@ARGV) {
> - push @ARGV, 'host';
> -}
> -foreach my $k (@ARGV) {
> -push @hos, selecthost($k);
> +if (@ARGV and $ARGV[0] eq '--check') {
> +$checkmode= 1;
> +shift @ARGV;
> +logm("checking builds are done...");
> +} else {
> +if (!@ARGV) {
> +push @ARGV, 'host';
> +}
> +foreach my $k (@ARGV) {
> +push @hos, selecthost($k);
> +}
>  }
>  }
>  
> @@ -49,18 +55,18 @@ our $ho;
>  my %distpath;
>  
>  sub packages () {
> -target_install_packages($ho,
> +target_install_packages($w_ho,
>  qw(bridge-utils vncsnapshot libaio1 libpixman-1-0
> libsdl1.2debian libglib2.0-0 liblzma5));
> -target_install_packages($ho,
> +target_install_packages($w_ho,
>   $ho->{Suite} =~ /squeeze/ ? "libyajl1" : 
> "libyajl2");
>  if ($ho->{Suite} !~ m/lenny|squeeze/) {
> -target_install_packages($ho, 'libfdt1');
> +target_install_packages($w_ho, 'libfdt1');
>  }
>  if ($r{arch} eq 'i386') {
> - target_install_packages($ho, 'libc6-xen');
> + target_install_packages($w_ho, 'libc6-xen');
>  }
> -target_install_packages($ho, @{toolstack()->{ExtraPackages}})
> +target_install_packages($w_ho, @{toolstack()->{ExtraPackages}})
>  if toolstack()->{ExtraPackages};
>  }
>  
> @@ -69,14 +75,14 @@ sub extract () {
>  push @parts, 'libvirt' if $r{toolstack} eq "libvirt";
>  
>  foreach my $part (@parts) {
> -target_extract_jobdistpath($ho, $part, "path_${part}dist",
> +target_extract_jobdistpath($w_ho, $part, "path_${part}dist",
>  $r{"${part}buildjob"}, \%distpath);
>  }
> -target_cmd_root($ho, '/sbin/ldconfig');
> +target_cmd_root($w_ho, '/sbin/ldconfig');
>  }
>  
>  sub adjustconfig () {
> -target_editfile_root($ho, "/etc/xen/xend-config.sxp",
> +target_editfile_root($w_ho, "/etc/xen/xend-config.sxp",
>"xend-config.sxp", sub {
>   my (@domains) = (qw(localhost localhost.localdomain),
>".".$c{DnsDomain}, ".".$c{TestHostDomain});
> @@ -108,13 +114,13 @@ sub adjustconfig () {
>  /etc/sysconfig/xencommons
>  /etc/default/xend
>  /etc/sysconfig/xend)) {
> -next unless target_file_exists($ho, $try);
> +next unless target_file_exists($w_ho, $try);
>  $trace_config_file= $try;
>  last;
>  }
>  die unless defined $trace_config_file;
>  
> -target_editfile_root($ho, $trace_config_file, sub {
> +target_editfile_root($w_ho, $trace_config_file, sub {
>  my $prnow;
>  $prnow= sub {
>  print EO "XENCONSOLED_TRACE=guest\n" or die $!;
> @@ -128,7 +134,7 @@ sub adjustconfig () {
>  $prnow->();
>  });
>  
> -target_cmd_root($ho, 'mkdir -p /var/log/xen/console');
> +target_cmd_root($w_ho, 'mkdir -p /var/log/xen/console');
>  
>  setup_cxfabric($ho);
>  }
> @@ -156,19 +162,19 @@ sub setupboot () {
>  $xenhopt .= " $append" if defined $append;
>  
>  my @hooks;
> -
> +
>  if (host_involves_pcipassthrough($ho)) {
>  push @hooks, {
>  EditBootOptions => sub {
>  my ($ho,$hopt,$kopt) = @_;
>  $$hopt .= ' iommu=on';
>  my $hide= ' xen-pcibac