All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Robert Ho <robert.hu@intel.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [OSSTEST PATCH 2/2] Nested hosts: Use hostnamepath() in create_webfile
Date: Mon, 16 Nov 2015 15:20:44 +0000	[thread overview]
Message-ID: <1447687244-16230-2-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1447687244-16230-1-git-send-email-ian.jackson@eu.citrix.com>

create_webfile needs a pathname in the shared public-html directory.
These paths need to be (a) stable (b) unique across all running jobs.
We achieve this by basing the filenames on the hostname and (for a
guest) the guest name.

But for an L2 guest we need to include the physical host name too,
because the L1 `host' is not unique.

Fix this by using hostnamepath(), replacing the open-coded single
iteration.

Reported-by: Ian Campbell <ian.campbell@citrix.com>
CC: Robert Ho <robert.hu@intel.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 47b3e6f..a66f8a9 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2262,9 +2262,7 @@ sub await_webspace_fetch_byleaf ($$$$$) {
 
 sub create_webfile ($$$) {
     my ($ho, $tail, $contents) = @_; # $contents as for file_link_contents
-    my $wf_rhs= $ho->{Name}."_".$tail;
-    # $ho->{Host} is set if $ho is a guest.
-    $wf_rhs= $ho->{Host}{Name}."_${wf_rhs}" if $ho->{Host};
+    my $wf_rhs= hostnamepath($ho)."_".$tail;
     my $wf_common= $c{WebspaceCommon}.$wf_rhs;
     my $wf_url= $c{WebspaceUrl}.$wf_common;
     my $wf_file= $c{WebspaceFile}.$wf_common;
-- 
1.7.10.4

  reply	other threads:[~2015-11-16 15:21 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                             ` Ian Jackson [this message]
2015-11-16 15:37                               ` [OSSTEST PATCH 2/2] Nested hosts: Use hostnamepath() in create_webfile 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

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=1447687244-16230-2-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=robert.hu@intel.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.