All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hu, Robert" <robert.hu@intel.com>
To: Ian Campbell <ian.campbell@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [OSSTEST PATCH 1/2] Nested hosts: Provide hostnamepath and hostnamepath_list
Date: Tue, 17 Nov 2015 10:32:36 +0000	[thread overview]
Message-ID: <9E79D1C9A97CFD4097BCE431828FDD3102390816@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1447753869.27871.123.camel@citrix.com>

> -----Original Message-----
> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Sent: Tuesday, November 17, 2015 5:51 PM
> To: Hu, Robert <robert.hu@intel.com>; Ian Jackson
> <ian.jackson@eu.citrix.com>; xen-devel@lists.xenproject.org
> Subject: Re: [OSSTEST PATCH 1/2] Nested hosts: Provide hostnamepath and
> hostnamepath_list
> 
> On Tue, 2015-11-17 at 02:14 +0000, Hu, Robert wrote:
> > > -----Original Message-----
> > > From: Ian Jackson [mailto:ian.jackson@eu.citrix.com]
> > > Sent: Monday, November 16, 2015 11:21 PM
> > > To: xen-devel@lists.xenproject.org
> > > Cc: Ian Campbell <ian.campbell@citrix.com>; Ian Jackson
> > > <ian.jackson@eu.citrix.com>; Ian Jackson <Ian.Jackson@eu.citrix.com>;
> > > Hu,
> > > Robert <robert.hu@intel.com>
> > > Subject: [OSSTEST PATCH 1/2] Nested hosts: Provide hostnamepath and
> > > hostnamepath_list
> > >
> > > This can (and often should) be used to replace $ho->{Name}.
> > >
> > > For an L0 host it returns "$ho->{Name}", ie HOST.
> > >
> > > For a plain guest or L1 guest it returns
> > > "$ho->{Host}{Name}_$ho->{Name}", ie HOST_GUEST or HOST_L1.
> > >
> > > For an L2 guest it recurses further, giving HOST_L1_L2.
> > >
> > > Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> > > CC: Robert Ho <robert.hu@intel.com>
> > > ---
> > >  Osstest/TestSupport.pm |   15 +++++++++++++++
> > >  1 file changed, 15 insertions(+)
> > >
> > > diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
> > > index 6be50e3..47b3e6f 100644
> > > --- a/Osstest/TestSupport.pm
> > > +++ b/Osstest/TestSupport.pm
> > > @@ -70,6 +70,7 @@ BEGIN {
> > >
> > >                        selecthost get_hostflags
> get_host_property
> > >                        get_target_property
> > > get_host_native_linux_console
> > > +                      hostnamepath hostnamepath_list
> > >                        power_state power_cycle
> power_cycle_sleep
> > >                        serial_fetch_logs
> > >                        propname_massage
> propname_check
> > > @@ -1063,6 +1064,20 @@ sub get_host_method_object ($$$) {
> > >      return $mo;
> > >  }
> > >
> > > +sub hostnamepath_list ($);
> > > +sub hostnamepath_list ($) {
> > > +    # returns list of guest/host names, innermost first
> > > +    my ($ho) = @_;
> > > +    return () unless $ho && $ho->{Name};
> > [Hu, Robert]
> >
> > Is the situation $ho or $ho->{Name} undefined normal? Shall we
> > add warning here?
> 
> It can happen through the recursion in the line below. i.e. this is a bit
> like the NULL terminator at the end of a linked list.
[Hu, Robert] 

Oh, I see. Yes, that's right.

> 
> >
> > > +    return ($ho->{Name}, hostnamepath_list($ho->{Host}));
> > > +}
> > > +
> > > +sub hostnamepath ($) {
> > > +    my ($ho) = @_;
> > > +    my @l = hostnamepath_list($ho);
> > > +    join '_', reverse @l;
> > > +}
> > > +
> > >  #---------- stashed files ----------
> > >
> > >  sub open_unique_stashfile ($) {
> > > --
> > > 1.7.10.4
> >
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

      reply	other threads:[~2015-11-17 10:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9E79D1C9A97CFD4097BCE431828FDD3102346249@SHSMSX103.ccr.corp.intel.com>
2015-11-10 19:46 ` Osstest nested patch v15 (was RE: [OSSTEST PATCH v14 PART 2 10-26/26] Nested HVM testing) Ian Jackson
2015-11-11  5:23   ` Hu, Robert
2015-11-11  9:35     ` Ian Jackson
2015-11-11 10:15       ` Hu, Robert
2015-11-11 11:08         ` Ian Jackson
2015-11-11 14:05           ` Ian Jackson
2015-11-11 17:00             ` Ian Jackson
2015-11-12  5:43             ` Hu, Robert
2015-11-12 16:10               ` Ian Jackson
2015-11-13  1:53                 ` Hu, Robert
2015-11-13 10:29                   ` Ian Jackson
2015-11-16  1:49                     ` Hu, Robert
2015-11-16 10:30                       ` Ian Campbell
2015-11-16 10:39                         ` Hu, Robert
2015-11-16 15:20                           ` Ian Jackson
2015-11-16 15:20                         ` Ian Jackson
2015-11-16 15:20                           ` [OSSTEST PATCH 1/2] Nested hosts: Provide hostnamepath and hostnamepath_list Ian Jackson
2015-11-16 15:20                             ` [OSSTEST PATCH 2/2] Nested hosts: Use hostnamepath() in create_webfile Ian Jackson
2015-11-16 15:37                               ` Ian Campbell
2015-11-16 15:37                             ` [OSSTEST PATCH 1/2] Nested hosts: Provide hostnamepath and hostnamepath_list Ian Campbell
2015-11-17  2:14                             ` Hu, Robert
2015-11-17  9:51                               ` Ian Campbell
2015-11-17 10:32                                 ` Hu, Robert [this message]

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=9E79D1C9A97CFD4097BCE431828FDD3102390816@SHSMSX103.ccr.corp.intel.com \
    --to=robert.hu@intel.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.