All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: improve logging
From: Minwoo Im @ 2019-04-10 14:25 UTC (permalink / raw)

In-Reply-To: <20190410141706.146455-1-hare@suse.de>

On 4/10/19 11:17 PM, Hannes Reinecke wrote:
> Currently nvme is very reluctant if it comes to logging anything,
> _unless_ it's an ANA AEN. So this patch tries to remedy this by
> decreasing the priority for the ANA AEN logging message, and improve
> the logging when calling nvme_reset_ctrl().
> 
> Signed-off-by: Hannes Reinecke <hare at suse.com>
> ---
>   drivers/nvme/host/core.c      | 44 +++++++++++++++++++++++++++++--------------
>   drivers/nvme/host/multipath.c |  5 ++++-
>   2 files changed, 34 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 8d285bfcd352..98260b2c7a6f 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -94,6 +94,24 @@ static void nvme_put_subsystem(struct nvme_subsystem *subsys);
>   static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl,
>   					   unsigned nsid);
>   
> +static const char *nvme_ctrl_state_name(struct nvme_ctrl *ctrl)
> +{
> +	static const char *const state_name[] = {
> +		[NVME_CTRL_NEW]		= "new",
> +		[NVME_CTRL_LIVE]	= "live",
> +		[NVME_CTRL_ADMIN_ONLY]	= "only-admin",
> +		[NVME_CTRL_RESETTING]	= "resetting",
> +		[NVME_CTRL_CONNECTING]	= "connecting",
> +		[NVME_CTRL_DELETING]	= "deleting",
> +		[NVME_CTRL_DEAD]	= "dead",
> +	};
> +
> +	if ((unsigned)ctrl->state < ARRAY_SIZE(state_name) &&
> +	    state_name[ctrl->state])
> +		return state_name[ctrl->state];
> +	return NULL;

Hi, Hannes,

IMHO, If you want to print out "unknown" in the caller level, why don't 
we just
return "unknown" string itself to the caller to make caller don't need 
to print
out "unknown" OR "unknown state\n" just like below ?

I think this might make duplications for "unknown" string in callers.

Thanks,

> +}
> +
>   static void nvme_set_queue_dying(struct nvme_ns *ns)
>   {
>   	/*
> @@ -119,10 +137,17 @@ static void nvme_queue_scan(struct nvme_ctrl *ctrl)
>   
>   int nvme_reset_ctrl(struct nvme_ctrl *ctrl)
>   {
> -	if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING))
> +	if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) {
> +		const char *state_name = nvme_ctrl_state_name(ctrl);
> +
> +		dev_warn(ctrl->device, "cannot reset ctrl in state %s\n",
> +			 state_name ? state_name : "unknown");
>   		return -EBUSY;
> -	if (!queue_work(nvme_reset_wq, &ctrl->reset_work))
> +	}
> +	if (!queue_work(nvme_reset_wq, &ctrl->reset_work)) {
> +		dev_dbg(ctrl->device, "ctrl reset already queued\n");
>   		return -EBUSY;
> +	}
>   	return 0;
>   }
>   EXPORT_SYMBOL_GPL(nvme_reset_ctrl);
> @@ -2971,19 +2996,10 @@ static ssize_t nvme_sysfs_show_state(struct device *dev,
>   				     char *buf)
>   {
>   	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
> -	static const char *const state_name[] = {
> -		[NVME_CTRL_NEW]		= "new",
> -		[NVME_CTRL_LIVE]	= "live",
> -		[NVME_CTRL_ADMIN_ONLY]	= "only-admin",
> -		[NVME_CTRL_RESETTING]	= "resetting",
> -		[NVME_CTRL_CONNECTING]	= "connecting",
> -		[NVME_CTRL_DELETING]	= "deleting",
> -		[NVME_CTRL_DEAD]	= "dead",
> -	};
> +	const char *state_name = nvme_ctrl_state_name(ctrl);
>   
> -	if ((unsigned)ctrl->state < ARRAY_SIZE(state_name) &&
> -	    state_name[ctrl->state])
> -		return sprintf(buf, "%s\n", state_name[ctrl->state]);
> +	if (state_name)
> +		return sprintf(buf, "%s\n", state_name);
>   
>   	return sprintf(buf, "unknown state\n");
>   }
> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index 503539d4616a..cca60044163b 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -81,6 +81,9 @@ void nvme_failover_req(struct request *req)
>   		 * Reset the controller for any non-ANA error as we don't know
>   		 * what caused the error.
>   		 */
> +		dev_info(ns->ctrl->device,
> +			"nvme status 0x%04x, resetting controller\n",
> +			status);
>   		nvme_reset_ctrl(ns->ctrl);
>   		break;
>   	}
> @@ -423,7 +426,7 @@ static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
>   	unsigned *nr_change_groups = data;
>   	struct nvme_ns *ns;
>   
> -	dev_info(ctrl->device, "ANA group %d: %s.\n",
> +	dev_dbg(ctrl->device, "ANA group %d: %s.\n",
>   			le32_to_cpu(desc->grpid),
>   			nvme_ana_state_names[desc->state]);
>   
> 

^ permalink raw reply

* [OSSTEST PATCH 41/62] ts-debian-fixup: Use debian_overlays_fixup_cmd
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

Otherwise we get the same error for guests as was prevented for hosts
by "preseed_base: chmod ssh host private keys to placate sshd".

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-debian-fixup | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ts-debian-fixup b/ts-debian-fixup
index 0e553d47..7d9d0398 100755
--- a/ts-debian-fixup
+++ b/ts-debian-fixup
@@ -206,7 +206,12 @@ savecfg();
 ether();
 target_kernkind_check($gho);
 access();
+
 debian_overlays($ho, \&overlay);
+target_cmd_root($ho, <<END.debian_overlays_fixup_cmd($ho, $mountpoint));
+set -ex
+END
+
 console();
 filesystems();
 otherfixupcfg();
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 01/62] gitignore: ignore vim swap file
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Wei Liu <wei.liu2@citrix.com>

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 425506b6..f7e5b77f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 *~
 *.bak
+*.swp
 tmp
 *.tmp
 bisection.ps
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 15/62] ts-debian-di-install: use gho to pick d-i
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Wei Liu <wei.liu2@citrix.com>

The original code used ho which gave us the host suite, but we wanted
the guest suite.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-debian-di-install | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ts-debian-di-install b/ts-debian-di-install
index 60079712..361a1710 100755
--- a/ts-debian-di-install
+++ b/ts-debian-di-install
@@ -152,8 +152,8 @@ sub setup_netboot($$$)
 	die if $r{ "$gho->{Guest}_netboot_kernel" }
 	||     $r{ "$gho->{Guest}_netboot_ramdisk" };
 
-	my $di_path = $c{TftpPath}.'/'.$ho->{Tftp}{DiBase}.'/'.${arch}.'/'.
-	    debian_guest_di_version($ho).'-'.$ho->{Suite};
+	my $di_path = $c{TftpPath}.'/'.$gho->{Tftp}{DiBase}.'/'.${arch}.'/'.
+	    debian_guest_di_version($gho).'-'.$gho->{Suite};
 
         if (${arch} =~ m/amd64|i386/) {
 	    $kernel = "$di_path/vmlinuz-xen";
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 24/62] overlay-persistent-net: Copy from jessie
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

These were copied from a system running Debian jessie.

The nontrivial files are:
 # Copyright (C) 2006 Marco d'Itri <md@Linux.IT>
 # Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
and licenced GPLv2+.  That is compatible with osstest's AGPLv3+.

Right now we do nothing with these.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 overlay-persistent-net/etc/init.d/udev-finish      |  22 +++
 .../etc/udev/rule_generator.functions              | 113 +++++++++++++++
 .../etc/udev/rules.d/73-usb-net-by-mac.rules       |   0
 .../etc/udev/rules.d/75-net-description.rules      |   0
 .../udev/rules.d/75-persistent-net-generator.rules | 143 +++++++++++++++++++
 overlay-persistent-net/etc/udev/udev-finish        |   9 ++
 overlay-persistent-net/etc/udev/write_net_rules    | 152 +++++++++++++++++++++
 .../lib/udev/rule_generator.functions              |   1 +
 overlay-persistent-net/lib/udev/udev-finish        |   1 +
 overlay-persistent-net/lib/udev/write_net_rules    |   1 +
 10 files changed, 442 insertions(+)
 create mode 100755 overlay-persistent-net/etc/init.d/udev-finish
 create mode 100644 overlay-persistent-net/etc/udev/rule_generator.functions
 create mode 100644 overlay-persistent-net/etc/udev/rules.d/73-usb-net-by-mac.rules
 create mode 100644 overlay-persistent-net/etc/udev/rules.d/75-net-description.rules
 create mode 100644 overlay-persistent-net/etc/udev/rules.d/75-persistent-net-generator.rules
 create mode 100755 overlay-persistent-net/etc/udev/udev-finish
 create mode 100755 overlay-persistent-net/etc/udev/write_net_rules
 create mode 120000 overlay-persistent-net/lib/udev/rule_generator.functions
 create mode 120000 overlay-persistent-net/lib/udev/udev-finish
 create mode 120000 overlay-persistent-net/lib/udev/write_net_rules

diff --git a/overlay-persistent-net/etc/init.d/udev-finish b/overlay-persistent-net/etc/init.d/udev-finish
new file mode 100755
index 00000000..10602017
--- /dev/null
+++ b/overlay-persistent-net/etc/init.d/udev-finish
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides:          udev-finish
+# Required-Start:    udev $local_fs
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Copy rules generated while the root was ro
+### END INIT INFO
+
+PATH="/sbin:/bin"
+
+. /lib/lsb/init-functions
+
+case "$1" in
+  start) ;;
+  stop|restart|force-reload) exit 0 ;;
+  *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;;
+esac
+
+exec /lib/udev/udev-finish
+
diff --git a/overlay-persistent-net/etc/udev/rule_generator.functions b/overlay-persistent-net/etc/udev/rule_generator.functions
new file mode 100644
index 00000000..925193e4
--- /dev/null
+++ b/overlay-persistent-net/etc/udev/rule_generator.functions
@@ -0,0 +1,113 @@
+# functions used by the udev rule generator
+
+# Copyright (C) 2006 Marco d'Itri <md@Linux.IT>
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+PATH='/sbin:/bin'
+
+# Read a single line from file $1 in the $DEVPATH directory.
+# The function must not return an error even if the file does not exist.
+sysread() {
+	local file="$1"
+	[ -e "/sys$DEVPATH/$file" ] || return 0
+	local value
+	read value < "/sys$DEVPATH/$file" || return 0
+	echo "$value"
+}
+
+sysreadlink() {
+	local file="$1"
+	[ -e "/sys$DEVPATH/$file" ] || return 0
+	readlink -f /sys$DEVPATH/$file 2> /dev/null || true
+}
+
+# Return true if a directory is writeable.
+writeable() {
+	if ln -s test-link $1/.is-writeable 2> /dev/null; then
+		rm -f $1/.is-writeable
+		return 0
+	else
+		return 1
+	fi
+}
+
+# Create a lock file for the current rules file.
+lock_rules_file() {
+	RUNDIR=/run/udev
+	[ -e "$RUNDIR" ] || return 0
+
+	RULES_LOCK="$RUNDIR/.lock-${RULES_FILE##*/}"
+
+	retry=30
+	while ! mkdir $RULES_LOCK 2> /dev/null; do
+		if [ $retry -eq 0 ]; then
+			 echo "Cannot lock $RULES_FILE!" >&2
+			 exit 2
+		fi
+		sleep 1
+		retry=$(($retry - 1))
+	done
+}
+
+unlock_rules_file() {
+	[ "$RULES_LOCK" ] || return 0
+	rmdir $RULES_LOCK || true
+}
+
+# Choose the real rules file if it is writeable or a temporary file if not.
+# Both files should be checked later when looking for existing rules.
+choose_rules_file() {
+	RUNDIR=/run/udev
+	local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
+	[ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
+
+	if writeable ${RULES_FILE%/*}; then
+		RO_RULES_FILE='/dev/null'
+	else
+		RO_RULES_FILE=$RULES_FILE
+		RULES_FILE=$tmp_rules_file
+	fi
+}
+
+# Return the name of the first free device.
+raw_find_next_available() {
+	local links="$1"
+
+	local basename=${links%%[ 0-9]*}
+	local max=-1
+	for name in $links; do
+		local num=${name#$basename}
+		[ "$num" ] || num=0
+		[ $num -gt $max ] && max=$num
+	done
+
+	local max=$(($max + 1))
+	# "name0" actually is just "name"
+	[ $max -eq 0 ] && return
+	echo "$max"
+}
+
+# Find all rules matching a key (with action) and a pattern.
+find_all_rules() {
+	local key="$1"
+	local linkre="$2"
+	local match="$3"
+
+	local search='.*[[:space:],]'"$key"'"('"$linkre"')".*'
+	echo $(sed -n -r -e 's/^#.*//' -e "${match}s/${search}/\1/p" \
+		$RO_RULES_FILE \
+		$([ -e $RULES_FILE ] && echo $RULES_FILE) \
+		2>/dev/null)
+}
diff --git a/overlay-persistent-net/etc/udev/rules.d/73-usb-net-by-mac.rules b/overlay-persistent-net/etc/udev/rules.d/73-usb-net-by-mac.rules
new file mode 100644
index 00000000..e69de29b
diff --git a/overlay-persistent-net/etc/udev/rules.d/75-net-description.rules b/overlay-persistent-net/etc/udev/rules.d/75-net-description.rules
new file mode 100644
index 00000000..e69de29b
diff --git a/overlay-persistent-net/etc/udev/rules.d/75-persistent-net-generator.rules b/overlay-persistent-net/etc/udev/rules.d/75-persistent-net-generator.rules
new file mode 100644
index 00000000..13551cfb
--- /dev/null
+++ b/overlay-persistent-net/etc/udev/rules.d/75-persistent-net-generator.rules
@@ -0,0 +1,143 @@
+# These rules generate rules to keep network interface names unchanged
+# across reboots and write them to /etc/udev/rules.d/70-persistent-net.rules.
+
+# variables used to communicate:
+#   MATCHADDR		MAC address used for the match
+#   MATCHID		bus_id used for the match
+#   MATCHDRV		driver name used for the match
+#   MATCHIFTYPE		interface type match
+#   COMMENT		comment to add to the generated rule
+#   INTERFACE_NAME	requested name supplied by external tool
+#   INTERFACE_NEW	new interface name returned by rule writer
+
+ACTION!="add",				GOTO="persistent_net_generator_end"
+SUBSYSTEM!="net",			GOTO="persistent_net_generator_end"
+
+# ignore the interface if a name has already been set
+NAME=="?*",				GOTO="persistent_net_generator_end"
+
+# new predictable network interface naming scheme
+# http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
+#IMPORT{cmdline}="net.ifnames"
+#ENV{net.ifnames}=="1",			GOTO="persistent_net_generator_end"
+
+# device name whitelist
+KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
+					GOTO="persistent_net_generator_end"
+
+# ignore Xen virtual interfaces
+SUBSYSTEMS=="xen",			GOTO="persistent_net_generator_end"
+
+# ignore UML virtual interfaces
+DRIVERS=="uml-netdev",			GOTO="persistent_net_generator_end"
+
+# ignore "secondary" raw interfaces of the madwifi driver
+KERNEL=="ath*", ATTRS{type}=="802",	GOTO="persistent_net_generator_end"
+
+# ignore "secondary" monitor interfaces of mac80211 drivers
+KERNEL=="wlan*", ATTRS{type}=="803",	GOTO="persistent_net_generator_end"
+
+# by default match on the MAC address and interface type
+ENV{MATCHADDR}="$attr{address}"
+ENV{MATCHIFTYPE}="$attr{type}"
+
+# match interface dev_id
+ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}"
+
+# These vendors are known to violate the local MAC address assignment scheme
+# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
+ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist"
+# 3Com
+ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist"
+# 3Com IBM PC; Imagen; Valid; Cisco; Apple
+ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist"
+# Intel
+ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist"
+# Olivetti
+ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist"
+# CMC Masscomp; Silicon Graphics; Prime EXL
+ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist"
+# Prominet Corporation Gigabit Ethernet Switch
+ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist"
+# BTI (Bus-Tech, Inc.) IBM Mainframes
+ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist"
+# Novell 2000
+ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist"
+# Realtec
+ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist"
+# Kingston Technologies
+ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist"
+
+
+# ignore interfaces with locally administered or null MAC addresses
+# and VMWare, Hyper-V, KVM, Virtualbox and Xen virtual interfaces
+ENV{MATCHADDR}=="?[2367abef]:*",	ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:00:00:00:00:00",	ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*|00:05:69:*|00:1C:14:*", \
+					ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:15:5d:*",		ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="52:54:00:*|54:52:00:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="08:00:27:*",		ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:16:3e:*",		ENV{MATCHADDR}=""
+
+# ignore Windows Azure Hyper-V virtual interfaces
+ENV{MATCHADDR}=="00:03:ff:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:0d:3a:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:1d:d8:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:12:5a:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:17:fa:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:22:48:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:25:ae:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="00:50:f2:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="28:18:78:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="50:1a:c5:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="60:45:bd:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="7c:1e:52:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="7c:ed:8d:*", ENV{MATCHADDR}=""
+ENV{MATCHADDR}=="dc:b4:c4:*", ENV{MATCHADDR}=""
+
+# ignore Ravello virtual interfaces
+ENV{MATCHADDR}=="2c:c2:60:*", ENV{MATCHADDR}=""
+
+LABEL="globally_administered_whitelist"
+
+# ibmveth interfaces have stable locally administered MAC addresses
+SUBSYSTEMS=="ibmveth",			ENV{MATCHADDR}="$attr{address}"
+
+# S/390 interfaces are matched only by id
+SUBSYSTEMS=="ccwgroup", \
+	ENV{MATCHDRV}="$driver", ENV{MATCHID}="$id", \
+	ENV{MATCHADDR}="", ENV{MATCHDEVID}=""
+
+# terminate processing if there are not enough conditions to create a rule
+ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", \
+					GOTO="persistent_net_generator_end"
+
+
+# provide nice comments for the generated rules
+SUBSYSTEMS=="pci", \
+ ENV{COMMENT}="PCI device $attr{vendor}:$attr{device}"
+SUBSYSTEMS=="pcmcia", \
+ ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id}"
+SUBSYSTEMS=="usb", \
+ ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct}"
+SUBSYSTEMS=="ccwgroup", \
+ ENV{COMMENT}="S/390 device at $id"
+SUBSYSTEMS=="ibmveth", \
+ ENV{COMMENT}="LPAR virtual device at $id"
+SUBSYSTEMS=="ieee1394", \
+ ENV{COMMENT}="Firewire device $attr{host_id}"
+ENV{COMMENT}=="", \
+ ENV{COMMENT}="Unknown $env{SUBSYSTEM} device ($env{DEVPATH})"
+ATTRS{driver}=="?*", \
+ ENV{COMMENT}="$env{COMMENT} ($attr{driver})"
+
+# ignore interfaces without a driver link like bridges and VLANs, otherwise
+# generate and write the rule
+DRIVERS=="?*", IMPORT{program}="write_net_rules"
+
+# rename the interface if requested
+ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
+
+LABEL="persistent_net_generator_end"
+
diff --git a/overlay-persistent-net/etc/udev/udev-finish b/overlay-persistent-net/etc/udev/udev-finish
new file mode 100755
index 00000000..85e3c720
--- /dev/null
+++ b/overlay-persistent-net/etc/udev/udev-finish
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+# Copy any rules generated while the root filesystem was read-only
+for file in /run/udev/tmp-rules--*; do
+  [ -e "$file" ] || continue
+  cat "$file" >> "/etc/udev/rules.d/${file##*tmp-rules--}"
+  rm -f "$file"
+done
+
diff --git a/overlay-persistent-net/etc/udev/write_net_rules b/overlay-persistent-net/etc/udev/write_net_rules
new file mode 100755
index 00000000..fedc0f1e
--- /dev/null
+++ b/overlay-persistent-net/etc/udev/write_net_rules
@@ -0,0 +1,152 @@
+#!/bin/sh -e
+
+# This script is run to create persistent network device naming rules
+# based on properties of the device.
+# If the interface needs to be renamed, INTERFACE_NEW=<name> will be printed
+# on stdout to allow udev to IMPORT it.
+
+# variables used to communicate:
+#   MATCHADDR             MAC address used for the match
+#   MATCHID               bus_id used for the match
+#   MATCHDEVID            dev_id used for the match
+#   MATCHDRV              driver name used for the match
+#   MATCHIFTYPE           interface type match
+#   COMMENT               comment to add to the generated rule
+#   INTERFACE_NAME        requested name supplied by external tool
+#   INTERFACE_NEW         new interface name returned by rule writer
+
+# Copyright (C) 2006 Marco d'Itri <md@Linux.IT>
+# Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# debug, if UDEV_LOG=<debug>
+if [ -n "$UDEV_LOG" ]; then
+	if [ "$UDEV_LOG" -ge 7 ]; then
+		set -x
+	fi
+fi
+
+RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'
+
+. /lib/udev/rule_generator.functions
+
+interface_name_taken() {
+	local value="$(find_all_rules 'NAME=' $INTERFACE)"
+	if [ "$value" ]; then
+		return 0
+	else
+		return 1
+	fi
+}
+
+find_next_available() {
+	raw_find_next_available "$(find_all_rules 'NAME=' "$1")"
+}
+
+write_rule() {
+	local match="$1"
+	local name="$2"
+	local comment="$3"
+
+	{
+	if [ "$PRINT_HEADER" ]; then
+		PRINT_HEADER=
+		echo "# This file was automatically generated by the $0"
+		echo "# program, run by the persistent-net-generator.rules rules file."
+		echo "#"
+		echo "# You can modify it, as long as you keep each rule on a single"
+		echo "# line, and change only the value of the NAME= key."
+	fi
+
+	echo ""
+	[ "$comment" ] && echo "# $comment"
+	echo "SUBSYSTEM==\"net\", ACTION==\"add\"$match, NAME=\"$name\""
+	} >> $RULES_FILE
+}
+
+if [ -z "$INTERFACE" ]; then
+	echo "missing \$INTERFACE" >&2
+	exit 1
+fi
+
+# Prevent concurrent processes from modifying the file at the same time.
+lock_rules_file
+
+# Check if the rules file is writeable.
+choose_rules_file
+
+# the DRIVERS key is needed to not match bridges and VLAN sub-interfaces
+if [ "$MATCHADDR" ]; then
+	match="$match, DRIVERS==\"?*\", ATTR{address}==\"$MATCHADDR\""
+fi
+
+if [ "$MATCHDRV" ]; then
+	match="$match, DRIVERS==\"$MATCHDRV\""
+fi
+
+if [ "$MATCHDEVID" ]; then
+	match="$match, ATTR{dev_id}==\"$MATCHDEVID\""
+fi
+
+if [ "$MATCHID" ]; then
+	match="$match, KERNELS==\"$MATCHID\""
+fi
+
+if [ "$MATCHIFTYPE" ]; then
+	match="$match, ATTR{type}==\"$MATCHIFTYPE\""
+fi
+
+if [ -z "$match" ]; then
+	echo "missing valid match" >&2
+	unlock_rules_file
+	exit 1
+fi
+
+basename=${INTERFACE%%[0-9]*}
+match="$match, KERNEL==\"$basename*\""
+
+# build a regular expression that matches the new rule that we want to write
+new_rule_pattern=$(echo "^SUBSYSTEM==\"net\", ACTION==\"add\"$match" | sed -re 's/([\?\*\{\}])/\\\1/g')
+
+# Double check if the new rule has already been written. This happens if
+# multiple add events are generated before the script returns and udevd
+# renames the interfaces. See #765577 for details.
+if egrep -qs "$new_rule_pattern" $RO_RULES_FILE $RULES_FILE; then
+	unlock_rules_file
+	exit 0
+fi
+
+if [ "$INTERFACE_NAME" ]; then
+	# external tools may request a custom name
+	COMMENT="$COMMENT (custom name provided by external tool)"
+	if [ "$INTERFACE_NAME" != "$INTERFACE" ]; then
+		INTERFACE=$INTERFACE_NAME;
+		echo "INTERFACE_NEW=$INTERFACE"
+	fi
+else
+	# if a rule using the current name already exists, find a new name
+	if interface_name_taken; then
+		INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
+		# prevent INTERFACE from being "eth" instead of "eth0"
+		[ "$INTERFACE" = "${INTERFACE%%[ \[\]0-9]*}" ] && INTERFACE=${INTERFACE}0
+		echo "INTERFACE_NEW=$INTERFACE"
+	fi
+fi
+
+write_rule "$match" "$INTERFACE" "$COMMENT"
+
+unlock_rules_file
+
+exit 0
diff --git a/overlay-persistent-net/lib/udev/rule_generator.functions b/overlay-persistent-net/lib/udev/rule_generator.functions
new file mode 120000
index 00000000..3b225ebf
--- /dev/null
+++ b/overlay-persistent-net/lib/udev/rule_generator.functions
@@ -0,0 +1 @@
+/etc/udev/rule_generator.functions
\ No newline at end of file
diff --git a/overlay-persistent-net/lib/udev/udev-finish b/overlay-persistent-net/lib/udev/udev-finish
new file mode 120000
index 00000000..2c2e3042
--- /dev/null
+++ b/overlay-persistent-net/lib/udev/udev-finish
@@ -0,0 +1 @@
+/etc/udev/udev-finish
\ No newline at end of file
diff --git a/overlay-persistent-net/lib/udev/write_net_rules b/overlay-persistent-net/lib/udev/write_net_rules
new file mode 120000
index 00000000..bfe37cc3
--- /dev/null
+++ b/overlay-persistent-net/lib/udev/write_net_rules
@@ -0,0 +1 @@
+/etc/udev/write_net_rules
\ No newline at end of file
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 20/62] ts-guests-nbd-mirror: use target_{get, put}file_root to transfter cfg
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Wei Liu <wei.liu2@citrix.com>

The original code used target_cmd_output_root which caused a trailing
new line to be deleted, which caused libvirt converter to fail.

It wasn't discovered until now because we appended too many "\n".

Use target_{get,put}file_root to do the job.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 ts-guests-nbd-mirror | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ts-guests-nbd-mirror b/ts-guests-nbd-mirror
index 7ea31f7c..06903aaa 100755
--- a/ts-guests-nbd-mirror
+++ b/ts-guests-nbd-mirror
@@ -154,8 +154,11 @@ sub shuffleconfigs () {
 	my $gn= $gns[$i];
 	my $gho= $ghos[$i];
 	my $cfgpath= $r{ "$gho->{Guest}_cfgpath" };
-	my $cfgdata= target_cmd_output_root($sho,"cat $cfgpath");
-	target_putfilecontents_root_stash($cho,10,$cfgdata,$cfgpath);
+	my $file= $cfgpath;
+	$file=~ s,/,-,g;
+	$file= "$stash/".hostnamepath($cho)."--$file";
+	target_getfile_root($sho, 60, $cfgpath, $file);
+	target_putfile_root($cho, 60, $file, $cfgpath);
     }
 }
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 38/62] ts-guests-nbd-mirror: Use target_getfile_root_stash
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

That removes the rather ad-hoc open-coding.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-guests-nbd-mirror | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ts-guests-nbd-mirror b/ts-guests-nbd-mirror
index 06903aaa..0365c47b 100755
--- a/ts-guests-nbd-mirror
+++ b/ts-guests-nbd-mirror
@@ -154,10 +154,7 @@ sub shuffleconfigs () {
 	my $gn= $gns[$i];
 	my $gho= $ghos[$i];
 	my $cfgpath= $r{ "$gho->{Guest}_cfgpath" };
-	my $file= $cfgpath;
-	$file=~ s,/,-,g;
-	$file= "$stash/".hostnamepath($cho)."--$file";
-	target_getfile_root($sho, 60, $cfgpath, $file);
+	my $file = target_getfile_root_stash($sho, 60, $cfgpath);
 	target_putfile_root($cho, 60, $file, $cfgpath);
     }
 }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 43/62] preseed_hook_installscript: Use partman/early_command, not preseed/
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

On iso-based installs, with stretch, preseed/early_command runs before
the network is up.  This causes the install to fail.

Our existing call sites add things to
   /usr/lib/base-installer.d/
   /lib/partman/init.d/
for which this is still early enough.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index f8ff4f46..3afea62b 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1484,11 +1484,12 @@ sub preseed_hook_command ($$$$) {
 
 sub preseed_hook_installscript ($$$$$) {
     my ($ho, $sfx, $installer_dir, $installer_leaf, $data) = @_;
+    # the specified script is installed via partman/early_command
     my $installer_pathname= "$installer_dir/$installer_leaf";
     my $urlfile= $installer_pathname;
     $urlfile =~ s/[^-_0-9a-z]/ sprintf "X%02x", ord($&) /ge;
     my $url= create_webfile($ho, $urlfile, $data);
-    preseed_hook_command($ho, 'early_command', $sfx, <<END);
+    preseed_hook_command($ho, 'partman/early_command', $sfx, <<END);
 #!/bin/sh
 set -ex
 mkdir -p '$installer_dir'
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 02/62] power: Fix uninitialised variable warning
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

In
  power: Record approach used for power cycles in runvars
we introduced a reference to $r{$rv} which might be undef,
resulting in this:
  Use of uninitialized value in concatenation (.) or string at Osstest/TestSupport.pm line 1069.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 334cc2cb..d35a784b 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1023,7 +1023,7 @@ sub power_reboot_attempts ($$$;$$) {
 	    logm("power: rebooted $ho->{Name} (using $approach->{Name})");
 	    if (defined $record_runvar_tail) {
 		my $rv = "$ho->{Ident}_power_${record_runvar_tail}";
-		my $newval = $r{$rv}.(!!length($r{$rv}) and ',')
+		my $newval = ($r{$rv} // '').(!!length($r{$rv}) and ',')
 		    .$approach->{Name};
 		store_runvar($rv, $newval);
 	    }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 13/62] Extend workaround `clk_ignore_unused' to stretch
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Stefano Stabellini, Wei Liu, Julien Grall
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Wei Liu <wei.liu2@citrix.com>

This is https://bugs.xenproject.org/xen/bug/45

Without that parameter we lose uart output.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@linaro.org>
---
 Osstest/Debian.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 82b5fb40..91bffdff 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -241,7 +241,7 @@ END
 	push @xenkopt, $xenkopt;
 	# http://bugs.xenproject.org/xen/bug/45
 	push @xenkopt, "clk_ignore_unused"
-	    if $ho->{Suite} =~ m/wheezy|jessie/;
+	    if $ho->{Suite} =~ m/wheezy|jessie|stretch/;
 
 	$xenkopt = join ' ', @xenkopt;
 	logm("Dom0 Linux options: $xenkopt");
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 52/62] target_install_packages: Consistently use qw(...) rather than '...'
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

qw(...) splits its argument into words.

There is one semantic change, where two package names were passed in a
single argument.  That worked by accident.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-xen-install | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ts-xen-install b/ts-xen-install
index 80952857..03f8c03e 100755
--- a/ts-xen-install
+++ b/ts-xen-install
@@ -53,18 +53,18 @@ sub packages () {
 			       qemu-utils
                                netcat-openbsd));
     if ($ho->{Suite} !~ m/squeeze|wheezy|jessie/) {
-        target_install_packages($ho, 'net-tools libnl-route-3-200');
+        target_install_packages($ho, qw(net-tools libnl-route-3-200));
     }
     if ($ho->{Suite} =~ m/jessie/) {
-        target_install_packages($ho, 'libnl-route-3-200');
+        target_install_packages($ho, qw(libnl-route-3-200));
     }
     target_install_packages($ho,
 			    $ho->{Suite} =~ /squeeze/ ? "libyajl1" : "libyajl2");
     if ($ho->{Suite} !~ m/lenny|squeeze/) {
-        target_install_packages($ho, 'libfdt1');
+        target_install_packages($ho, qw(libfdt1));
     }
     if ($r{arch} eq 'i386') {
-	target_install_packages($ho, 'libc6-xen');
+	target_install_packages($ho, qw(libc6-xen));
     }
     target_install_packages($ho, @{toolstack($ho)->{ExtraPackages}})
         if toolstack($ho)->{ExtraPackages};
@@ -88,7 +88,7 @@ sub some_extradebs ($) {
 	    $ontarget = "extrapackages-$cfgvar-$counter"; $counter++;
 	    $dpkgopts = '-iGROEB';
 	    logm("$cfgvar: updating packages from directory $path");
-	    target_install_packages($ho, 'rsync') unless $rsync_installed++;
+	    target_install_packages($ho, qw(rsync)) unless $rsync_installed++;
 	    target_putfile_root($ho,300, "$path/.", $ontarget, '-r');
 	} elsif ($path =~ m{\.deb$}) {
 	    $path =~ s{_\.deb}{ "_$r{arch}.deb" }e;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 06/62] Debian.pm: use sysvinit-core instead of systemd
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Wei Liu <wei.liu2@citrix.com>

Install that packages for suites >wheezy, because they use systemd as
the default init.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 59c60d40..82b5fb40 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -812,7 +812,7 @@ sub preseed_base ($$$;@) {
 
     # Systemd doesn't honor osstest-confirm-booted service, which
     # breaks ts-leak-check.  Fall back to SysV init for now.
-    if ( $suite =~ /jessie/ ) {
+    if ( $suite !~ /squeeze|wheezy/ ) {
        preseed_hook_command($ho, 'late_command', $sfx, <<END)
 in-target apt-get install -y sysvinit-core
 END
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 25/62] persistent-net: Add overlay on installed systems >= stretch
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

This prepares the ground for turning off net.ifnames.  The actual
rules are gated on net.ifnames so right now there is no change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 414cd897..e246c012 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -798,6 +798,13 @@ sub debian_overlays ($$) {
     };
     my $suite = $ho->{Suite};
     $maybe->('overlay');
+
+    # In stretch and later, net.ifnames=1, the fdo-style `predictable
+    # network device names', is the default; but it is anything but
+    # predictable, so we disable it.  Instead, we restore the
+    # 75-persistent-net-generator mechanism from jessie and earlier.
+    $maybe->("overlay-persistent-net") if $ho->{Suite} !~ m/wheezy|jessie/;
+
     $maybe->("overlay-$suite");
     $maybe->($c{OverlayLocal}, 'overlay-local.tar');
     $maybe->("$c{OverlayLocal}-$suite", 'overlay-local-$suite.tar');
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 26/62] persistent-net: Add overlay in installer >= stretch
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

We are going to need this in the installer so that the interface names
from the installer environment are captured so that they can be the
same on the host.

This prepares the ground for turning off net.ifnames.  The actual
rules are gated on net.ifnames so right now there is no change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-host-install | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ts-host-install b/ts-host-install
index 9ab3de62..8ea81e24 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -188,6 +188,13 @@ sub setup_netboot_firstboot($) {
     system qw(rm -rf --),"$initrd_overlay.d";
     mkdir "$initrd_overlay.d" or die "$initrd_overlay.d: $!";
 
+    if ($ho->{Suite} !~ m/wheezy|jessie/) {
+	my @cmd = (qw(cp -dR overlay-persistent-net/.),
+		   "$initrd_overlay.d/.");
+	logm("using persistent-net-generator: @cmd");
+	system_checked @cmd;
+    }
+
     my $ipappend = 2;
     my $wantphysif= get_host_property($ho,'interface force','auto');
     logm("Forcing interface $wantphysif");
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 23/62] contents_make_cpio: Make files owned by root
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

This function is called to generate overlays for use, mainly, by the
initramfs.

We are going to use it to ship udev rules.  Annoyingly, udev hates
files which aren't owned by root - it simply ignores them.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 1f01ac6a..41f6f5f8 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1521,7 +1521,7 @@ sub contents_make_cpio ($$$) {
         open STDIN, 'find ! -name "*~" ! -name "#*" -type f,l -print0 |'
             or die $!;
         open STDOUT, '>&', $fh or die $!;
-        system "cpio -H$format -o --quiet -0 -R 1000:1000";
+        system "cpio -H$format -o --quiet -0 -R 0:0";
         $? and die $?;
         $!=0; close STDIN; die "$! $?" if $! or $?;
         exit 0;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 45/62] Debian: partman scripts: Run right away too
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

We are switching the installation of these to partman/early_command
which runs as a result of a /lib/partman/init.d hook.  That means that
things we install don't get picked up, so run them right away (too).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index d1b52b5b..9dec321f 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1157,7 +1157,7 @@ sub preseed_create ($$;@) {
     my $d_i = $ho->{Tftp}{Path}.'/'.di_installer_path($ho);
 
     preseed_hook_installscript($ho, $sfx,
-          '/lib/partman/init.d', '000override-parted-devices', <<END);
+          '/lib/partman/init.d', '000override-parted-devices', <<END, 1);
 #!/bin/sh
 set -ex
 cd /bin
@@ -1171,7 +1171,7 @@ chmod +x parted_devices
 END
 
     preseed_hook_installscript($ho, $sfx,
-          '/lib/partman/init.d', '25erase-other-disks', <<END);
+          '/lib/partman/init.d', '25erase-other-disks', <<END, 1);
 #!/bin/sh
 set -ex
 stamp=/var/erase-other-disks.stamp
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 48/62] dm restrict audit: actually install right package for fishdescriptor
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

In
  dm restrict audit: install newer chiark-scripts for fishdescriptor
a locally-provided chiark-scripts_6.0.2_all.deb was installed for
jessie.  For stretch a backport was installed, but mistakenly
of chiark-utils-bin rather than chiark-scripts.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 79b7960d..9aa88822 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1060,7 +1060,7 @@ sub preseed_create_guest ($$$;@) {
     if (grep { m/_dmrestrict$/ && $r{$_} } keys %r and
 	$suite =~ m/stretch/) {
 	preseed_backports_packages($ho, $sfx, \%xopts, $suite,
-				   qw(chiark-utils-bin));
+				   qw(chiark-scripts));
     }
 
     my $preseed_file= preseed_base($ho, $sfx, $extra_packages, %xopts);
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 16/62] make-flight: guest should use jessie to test pvgrub
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Wei Liu
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Wei Liu <wei.liu2@citrix.com>

stretch has 64bit feature enabled for ext4, which pvgrub can't cope.
We want to continue to test pvgrub, so specify jessie in the guest
suite field.

A consequence is that this test will test jessie forever.  Eventually
jessie will rot so badly that this test fails and then we will no
longer be testing pvgrub1.  Hopefully by then no-one will be using it.

CC: Juergen Gross <jgross@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v4: Adjust commit message slightly.
---
 make-flight | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/make-flight b/make-flight
index 93c82a21..2f875125 100755
--- a/make-flight
+++ b/make-flight
@@ -608,8 +608,8 @@ do_pvgrub_tests () {
   job_create_test test-$xenarch$kern-$dom0arch-amd64-pvgrub     \
     test-debian-di xl $xenarch $dom0arch                        \
       debian_arch=amd64                                         \
-      debian_suite=$guestsuite                                  \
-      debian_di_version=$guest_di_version                       \
+      debian_suite=jessie                                       \
+      debian_di_version=`getconfig_TftpDiVersion_suite jessie`  \
       debian_method=netboot                                     \
       debian_bootloader=pvgrub                                  \
       all_hostflags=$most_hostflags                             \
@@ -617,8 +617,8 @@ do_pvgrub_tests () {
   job_create_test test-$xenarch$kern-$dom0arch-i386-pvgrub      \
     test-debian-di xl $xenarch $dom0arch                        \
       debian_arch=i386                                          \
-      debian_suite=$guestsuite                                  \
-      debian_di_version=$guest_di_version                       \
+      debian_suite=jessie                                       \
+      debian_di_version=`getconfig_TftpDiVersion_suite jessie`  \
       debian_method=netboot                                     \
       debian_bootloader=pvgrub                                  \
       all_hostflags=$most_hostflags
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 49/62] Debian: Move preseed_backports_packages earlier
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 88 +++++++++++++++++++++++++++----------------------------
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 9aa88822..25bf8e88 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -823,6 +823,50 @@ chmod 600 $subdir/etc/ssh/ssh_host_*_key ||:
 END
 }
 
+sub preseed_backports_packages ($$$$@) {
+    my ($ho, $sfx, $xopts, $suite, @pkgs) = @_;
+
+    if (! $xopts->{BackportsSourcesAlreadyAdded}++) {
+	my $bp_url = $c{"DebianSnapshotBackports_$suite"};
+	$bp_url ||= "http://$c{DebianMirrorHost}/$c{DebianMirrorSubpath}";
+
+	my $apt_insert='';
+	my $extra_rune='';
+	if ($suite =~ m/wheezy|jessie/) {
+	    # this has global effect, unfortunately
+	    $extra_rune = <<END;
+d=/target/etc/apt/apt.conf.d
+mkdir -p \$d
+cat >\$d/50osstestsnapshot <<EOF
+Acquire::Check-Valid-Until false;
+EOF
+END
+	} else {
+	    $apt_insert = '[check-valid-until=no]';
+	}
+
+	preseed_hook_command($ho, 'late_command', $sfx, <<END);
+#!/bin/sh
+set -ex
+
+cat <<EOF >>/target/etc/apt/sources.list
+
+# $suite backports
+deb $apt_insert $bp_url $suite-backports main
+EOF
+$extra_rune
+in-target apt-get update
+END
+    }
+
+    preseed_hook_command($ho, 'late_command', $sfx, <<END);
+#!/bin/sh
+set -ex
+
+in-target apt-get install -y -t $suite-backports @pkgs
+END
+}
+
 sub preseed_base ($$$;@) {
     my ($ho,$sfx,$extra_packages,%xopts) = @_;
 
@@ -986,50 +1030,6 @@ END
     return $preseed;
 }
 
-sub preseed_backports_packages ($$$$@) {
-    my ($ho, $sfx, $xopts, $suite, @pkgs) = @_;
-
-    if (! $xopts->{BackportsSourcesAlreadyAdded}++) {
-	my $bp_url = $c{"DebianSnapshotBackports_$suite"};
-	$bp_url ||= "http://$c{DebianMirrorHost}/$c{DebianMirrorSubpath}";
-
-	my $apt_insert='';
-	my $extra_rune='';
-	if ($suite =~ m/wheezy|jessie/) {
-	    # this has global effect, unfortunately
-	    $extra_rune = <<END;
-d=/target/etc/apt/apt.conf.d
-mkdir -p \$d
-cat >\$d/50osstestsnapshot <<EOF
-Acquire::Check-Valid-Until false;
-EOF
-END
-	} else {
-	    $apt_insert = '[check-valid-until=no]';
-	}
-
-	preseed_hook_command($ho, 'late_command', $sfx, <<END);
-#!/bin/sh
-set -ex
-
-cat <<EOF >>/target/etc/apt/sources.list
-
-# $suite backports
-deb $apt_insert $bp_url $suite-backports main
-EOF
-$extra_rune
-in-target apt-get update
-END
-    }
-
-    preseed_hook_command($ho, 'late_command', $sfx, <<END);
-#!/bin/sh
-set -ex
-
-in-target apt-get install -y -t $suite-backports @pkgs
-END
-}
-
 sub preseed_create_guest ($$$;@) {
     my ($ho, $arch, $sfx, %xopts) = @_;
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 17/62] stretch: Use chainloading when booting using GRUB on Arm64
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, Wei Liu
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

From: Julien Grall <julien.grall@arm.com>

The GRUB package in stretch is not able to boot Xen on Arm64.
Use chainloading as we did for jessie for the time being.

Note that a bug has been filled on Debian to integrate Xen
pactches for the next release (see [1]).

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884770

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v4: Correct suite name capitalisation in commit message and comment.
---
 Osstest/Debian.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 85b1890d..80b4cf37 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -435,10 +435,10 @@ sub setupboot_grub2 ($$$$) {
     my $rmenu= '/boot/grub/grub.cfg';
     my $kernkey= (defined $xenhopt ? 'KernDom0' : 'KernOnly');
 
-    # Grub2 on Jessie/arm* doesn't do multiboot, so we must chainload.
+    # Grub2 on jessie/stretch ARM* doesn't do multiboot, so we must chainload.
     my $need_uefi_chainload =
         get_host_property($ho, "firmware", "") eq "uefi" &&
-        $ho->{Suite} =~ m/jessie/ && $r{arch} =~ m/^arm/;
+        $ho->{Suite} =~ m/jessie|stretch/ && $r{arch} =~ m/^arm/;
 
     my $parsemenu= sub {
         my $f= bl_getmenu_open($ho, $rmenu, "$stash/$ho->{Name}--grub.cfg.1");
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 00/62] Update to Debian stable (stretch)
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: committers, Ian Jackson

This, finally, is the series to update osstest to Debian stretch.
This is very urgent because Debian have been removing parts of jessie
from their servers, in a rather unhelpful and not entirely controlled
manner.  Consequently, currently osstest is not reliable with jessie.

I am going to push this series to osstest pretest immediately without
waiting for acks/reviews/etc.  I expect it to trip two regressions in
the osstest push gate, which I will force push.

One effect of this series is to put into service the two ThunderX
arm64 machines, rochester[01], which are supportable in stretch but
not jessie.

There seem to be a number of outstanding problems which I decided were
not blockers:

 * test-amd64-amd64-xl-qcow2 fails because the xvd driver fails to
   freeze during the Linux guest suspend.  This seems to be a real bug
   of some kind and needs investigation.

 * I experienced difficulties with the 4 Arndale devboards: high
   probability guest start failures.  For now I have marked those
   nodes as unsuitable for use with stretch, which will, effectively,
   take them out of service - and leave us with a lack of armhf
   capacity.  It is possible that this problem is due to the
   ifupdown-hotplug issue, now addressed, so I plan to retest.

 * The serial output from the new rochester arm64 machines is missing
   some of the grub bootloader messages (and this is detected by one
   of the examine jobs).  I may need help from someone familiar with
   these machines' hardware/firmware.

 * stretch did not appear to work properly on joubertin[01] and
   merlot[01] (x86 boxes).  I have marked them to be not used with
   stretch.  They will need to be retested and the problems
   investigated (if indeed the problems still remain after other fixes
   which are now in this series).

 * I have two bug reports / patches to go upstream to Debian: a boot
   ordering bug with ifupdown and udev, and a bug in fishdescriptor.

There are a couple of occurrences in this series of changes which
break things followed by patches to fix them up.  I have not bothered
squashing/reorganising those.

Ian Jackson (41):
  power: Fix uninitialised variable warning
  Debian: Fix http:// url for bugs.xenproject.org
  contents_make_cpio: Include symlinks
  contents_make_cpio: Make files owned by root
  overlay-persistent-net: Copy from jessie
  persistent-net: Add overlay on installed systems >= stretch
  persistent-net: Add overlay in installer >= stretch
  ts-host-install: Break out $persistent_net_rules
  ts-host-install: Unconditionally mkdir -p /etc/udev/rules.d
  ts-host-install: Put canary in 70-persistent-net.rules
  persistent-net: Include initramfs script to copy to target
  persistent-net: Set net.ifnames=0 in di_installcmdline_core
  ts-kernel-build: Enable some additional drivers for Thunder-X
  TestSupport: Move `stashed files' and `next_unique_name' earlier
  TestSupport: Move `target_somefile_getleaf' earlier
  TestSupport: target_somefile_leaf rename and change a variable
  TestSupport: Provide target_getfile_root_stash
  ts-guests-nbd-mirror: Use target_getfile_root_stash
  preseed_base: chmod ssh host private keys to placate sshd
  preseed_base: break out debian_overlays_fixup_cmd
  ts-debian-fixup: Use debian_overlays_fixup_cmd
  preseed_hook_command: allow specifying di keys other than preseed/*
  preseed_hook_installscript: Use partman/early_command, not preseed/
  Debian: preseed_hook_installscript: New $atonce option
  Debian: partman scripts: Run right away too
  Debian: set partman-lvm/device_remove_lvm_span
  Debian: Add reference to bug numbers for erase-other-disks
  dm restrict audit: actually install right package for fishdescriptor
  Debian: Move preseed_backports_packages earlier
  dm restrict audit: actually install fishdescriptor in host
  dm restrict audit: always install (some) chiark-scripts
  target_install_packages: Consistently use qw(...) rather than '...'
  ts-xen-install: Install libpciaccess0
  ts-debian-hvm-install: Honour linux_boot_append target var
  make-flight: shadow test: Disable kpti in guests
  platforms: Pass suite to get_arch_platforms
  platforms: Honour suite in get_arch_platforms
  dm restrict, fishdescriptor: Update to a fixed chiark-scripts
  Debian: Fix /lib/udev/ifupdown-hotplug to not run if / is ro
  Debian: Fix /lib/udev/ifupdown-hotplug in guests from debootstrap
  production-config-cambridge: Provide TftpDiVersion_stretch

Julien Grall (2):
  stretch: Use chainloading when booting using GRUB on Arm64
  ts-xen-build: Enable ITS driver in Xen

Wei Liu (19):
  gitignore: ignore vim swap file
  ts-xen-build-prep: only install w3c-dtd-xhtml for suites <Stretch
  ts-xen-build-prep: install packages for suites >jessie
  ts-xen-install: install some packages on stretch
  Debian.pm: use sysvinit-core instead of systemd
  ts-leak-check: suppress systemd-shim, which leaks in stretch
  ts-host-install: don't use the new nic naming scheme
  ts-debian-fixup: merge origin extra= to our own if necessary
  ts-debian-fixup: append noresume
  ts-xen-build-prep: install e2fslibs-dev
  ts-guests-nbd-mirror: make it work with stretch
  Extend workaround `clk_ignore_unused' to stretch
  adjust how to skip bootloader installation for arm32, in Stretch
  ts-debian-di-install: use gho to pick d-i
  make-flight: guest should use jessie to test pvgrub
  Drop rumprun tests
  ts-guests-nbd-mirror: use target_{get,put}file_root to transfter cfg
  ts-kernel-build: disable host1x, which doesn't build
  Switch to Debian Stretch

 .gitignore                                         |   1 +
 Osstest.pm                                         |   2 +-
 Osstest/Debian.pm                                  | 205 ++++++++++++++-------
 Osstest/HostDB/Executive.pm                        |  10 +-
 Osstest/HostDB/Static.pm                           |   4 +-
 Osstest/RumpRun.pm                                 |  68 -------
 Osstest/TestSupport.pm                             | 115 ++++++------
 Osstest/Toolstack/rumprun.pm                       |  33 ----
 allow.all                                          |   1 -
 allow.rumprun                                      |   1 -
 ap-common                                          |   7 -
 ap-fetch-version                                   |   4 -
 ap-fetch-version-old                               |   5 -
 ap-print-url                                       |   3 -
 ap-push                                            |   5 -
 cr-daily-branch                                    |   9 -
 cri-common                                         |   1 -
 cri-getplatforms                                   |   2 +-
 crontab                                            |   4 +-
 daily-cron-email-real--rumpuserxen                 |   4 -
 daily-cron-email-real-bisectcomplete--rumpuserxen  |   4 -
 make-flight                                        |  48 +----
 mfi-common                                         |  37 ----
 overlay-persistent-net/etc/init.d/udev-finish      |  22 +++
 .../etc/udev/rule_generator.functions              | 113 ++++++++++++
 .../etc/udev/rules.d/73-usb-net-by-mac.rules       |   0
 .../etc/udev/rules.d/75-net-description.rules      |   0
 .../udev/rules.d/75-persistent-net-generator.rules | 143 ++++++++++++++
 overlay-persistent-net/etc/udev/udev-finish        |   9 +
 overlay-persistent-net/etc/udev/write_net_rules    | 152 +++++++++++++++
 .../lib/udev/rule_generator.functions              |   1 +
 overlay-persistent-net/lib/udev/udev-finish        |   1 +
 overlay-persistent-net/lib/udev/write_net_rules    |   1 +
 production-config                                  |   3 +
 production-config-cambridge                        |   1 +
 sg-run-job                                         |  26 ---
 ts-debian-di-install                               |   4 +-
 ts-debian-fixup                                    |  23 ++-
 ts-debian-hvm-install                              |   3 +
 ts-guests-nbd-mirror                               |  51 ++++-
 ts-host-install                                    |  23 ++-
 ts-kernel-build                                    |  14 ++
 ts-leak-check                                      |   1 +
 ts-rumprun-bake                                    |  88 ---------
 ts-rumprun-build                                   | 103 -----------
 ts-rumprun-demo-build                              |  67 -------
 ts-rumprun-demo-setup                              |  54 ------
 ts-rumprun-demo-xenstorels                         | 113 ------------
 ts-rumprun-test-prep                               |  37 ----
 ts-xen-build                                       |   4 +
 ts-xen-build-prep                                  |  16 +-
 ts-xen-install                                     |  12 +-
 52 files changed, 803 insertions(+), 855 deletions(-)
 delete mode 100644 Osstest/RumpRun.pm
 delete mode 100644 Osstest/Toolstack/rumprun.pm
 delete mode 100644 allow.rumprun
 delete mode 100644 daily-cron-email-real--rumpuserxen
 delete mode 100644 daily-cron-email-real-bisectcomplete--rumpuserxen
 create mode 100755 overlay-persistent-net/etc/init.d/udev-finish
 create mode 100644 overlay-persistent-net/etc/udev/rule_generator.functions
 create mode 100644 overlay-persistent-net/etc/udev/rules.d/73-usb-net-by-mac.rules
 create mode 100644 overlay-persistent-net/etc/udev/rules.d/75-net-description.rules
 create mode 100644 overlay-persistent-net/etc/udev/rules.d/75-persistent-net-generator.rules
 create mode 100755 overlay-persistent-net/etc/udev/udev-finish
 create mode 100755 overlay-persistent-net/etc/udev/write_net_rules
 create mode 120000 overlay-persistent-net/lib/udev/rule_generator.functions
 create mode 120000 overlay-persistent-net/lib/udev/udev-finish
 create mode 120000 overlay-persistent-net/lib/udev/write_net_rules
 delete mode 100755 ts-rumprun-bake
 delete mode 100755 ts-rumprun-build
 delete mode 100755 ts-rumprun-demo-build
 delete mode 100755 ts-rumprun-demo-setup
 delete mode 100755 ts-rumprun-demo-xenstorels
 delete mode 100755 ts-rumprun-test-prep

-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply

* [OSSTEST PATCH 50/62] dm restrict audit: actually install fishdescriptor in host
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

In
  dm restrict audit: install newer chiark-scripts for fishdescriptor
arrangements were made to install a backport of chiark-scripts
but the code was mistakenly placed in preseed_create_guest but
of course it's needed in the host.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/Debian.pm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 25bf8e88..8d53bbe1 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1022,6 +1022,12 @@ END
     # security.d.o CDN seems unreliable right now
     # and jessie-updates is no more
 
+    if (grep { m/_dmrestrict$/ && $r{$_} } keys %r and
+	$suite =~ m/stretch/) {
+	preseed_backports_packages($ho, $sfx, \%xopts, $suite,
+				   qw(chiark-scripts));
+    }
+
     $preseed .= <<"END";
 
 ### END OF DEBIAN PRESEED BASE
@@ -1057,11 +1063,6 @@ sub preseed_create_guest ($$$;@) {
             $extra_packages = "pv-grub-menu";
         }
     }
-    if (grep { m/_dmrestrict$/ && $r{$_} } keys %r and
-	$suite =~ m/stretch/) {
-	preseed_backports_packages($ho, $sfx, \%xopts, $suite,
-				   qw(chiark-scripts));
-    }
 
     my $preseed_file= preseed_base($ho, $sfx, $extra_packages, %xopts);
     $preseed_file.= (<<END);
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 55/62] make-flight: shadow test: Disable kpti in guests
From: Ian Jackson @ 2019-04-10 14:24 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

Since Spectre/Meltdown, shadow has been a lot slower, especially with
KPTI in the guest.  Empirically, too slow (with the kernel from Debian
stretch).

CC: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 make-flight | 1 +
 1 file changed, 1 insertion(+)

diff --git a/make-flight b/make-flight
index 151b1435..1e3ebd5c 100755
--- a/make-flight
+++ b/make-flight
@@ -493,6 +493,7 @@ do_shadow_tests () {
             $debian_runvars all_hostflags=$most_hostflags
 
   do_hvm_debian_test_one debianhvm xl seabios false '' -shadow \
+                         all_guest_linux_boot_append=nopti \
                          "xen_boot_append=hap=false"
 }
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [OSSTEST PATCH 56/62] platforms: Pass suite to get_arch_platforms
From: Ian Jackson @ 2019-04-10 14:24 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

The available platforms may depend on the suite to be used.

For now we use $defsuite from make-flight, which is not entirely right
but it will do for now because we don't use other suites much.

No functional change yet since neither implementation uses it.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/HostDB/Executive.pm | 4 ++--
 Osstest/HostDB/Static.pm    | 4 ++--
 cri-getplatforms            | 2 +-
 make-flight                 | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Osstest/HostDB/Executive.pm b/Osstest/HostDB/Executive.pm
index d42250f6..bf6ec57d 100644
--- a/Osstest/HostDB/Executive.pm
+++ b/Osstest/HostDB/Executive.pm
@@ -90,8 +90,8 @@ END
     return $flags;
 }
 
-sub get_arch_platforms ($$) {
-    my ($hd, $blessing, $arch) = @_;
+sub get_arch_platforms ($$$) {
+    my ($hd, $blessing, $arch, $suite) = @_;
 
     my @plats = ( );
     my $platsq = $dbh_tests->prepare(<<END);
diff --git a/Osstest/HostDB/Static.pm b/Osstest/HostDB/Static.pm
index ab9542dd..0c6be3ee 100644
--- a/Osstest/HostDB/Static.pm
+++ b/Osstest/HostDB/Static.pm
@@ -72,8 +72,8 @@ sub get_flags ($$) { #method
     return $flags;
 }
 
-sub get_arch_platforms ($$) {
-    my ($hd, $blessing, $arch) = @_;
+sub get_arch_platforms ($$$) {
+    my ($hd, $blessing, $arch, $suite) = @_;
 
     my $prop = "Platforms".ucfirst($arch);
 
diff --git a/cri-getplatforms b/cri-getplatforms
index 2bf13483..2b8cee0b 100755
--- a/cri-getplatforms
+++ b/cri-getplatforms
@@ -20,6 +20,6 @@ getplatforms () {
         perl -e '
                 use Osstest;
                 csreadconfig();
-                print join " ", $mhostdb->get_arch_platforms("'$blessing'", "'$1'") or die $!;
+                print join " ", $mhostdb->get_arch_platforms("'$blessing'", "'$1'", "'$2'") or die $!;
         '
 }
diff --git a/make-flight b/make-flight
index 1e3ebd5c..92dacb35 100755
--- a/make-flight
+++ b/make-flight
@@ -27,9 +27,9 @@ buildflight=$4
 flight=`./cs-flight-create $blessing $branch`
 
 . ./cri-common
-. ./cri-getplatforms
 . ./ap-common
 . ./mfi-common
+. ./cri-getplatforms
 
 # Older versions of Xen may not build with the current default.  Note
 # that branches older than 4.3 might need something even older than
@@ -612,7 +612,7 @@ do_pv_debian_tests () {
 
   for xsm in $xsms ; do
     # Basic PV Linux test with xl
-    for platform in '' `getplatforms $xenarch` ; do
+    for platform in '' `getplatforms $xenarch $defsuite` ; do
 
       # xsm test is not platform specific
       if [ x$xsm = xtrue -a x$platform != x ]; then
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related

* [Xen-devel] [OSSTEST PATCH 27/62] ts-host-install: Break out $persistent_net_rules
From: Ian Jackson @ 2019-04-10 14:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <20190410142408.22848-1-ian.jackson@eu.citrix.com>

We're going to want to reuse this value.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-host-install | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ts-host-install b/ts-host-install
index 8ea81e24..f80a151c 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -195,6 +195,9 @@ sub setup_netboot_firstboot($) {
 	system_checked @cmd;
     }
 
+    my $persistent_net_rules =
+	"$initrd_overlay.d/etc/udev/rules.d/70-persistent-net.rules";
+
     my $ipappend = 2;
     my $wantphysif= get_host_property($ho,'interface force','auto');
     logm("Forcing interface $wantphysif");
@@ -206,7 +209,7 @@ sub setup_netboot_firstboot($) {
 	# ip(8) moved to /sbin in Jessie
 	my $ipcmd = $ho->{Suite} =~ m/wheezy/ ? "/bin/ip" : "/sbin/ip";
         file_simple_write_contents
-            ("$initrd_overlay.d/etc/udev/rules.d/70-persistent-net.rules",
+            ($persistent_net_rules,
              $ho->{Flags}{'force-mac-address'} ? <<END : <<END);
 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="$wantphysif", RUN += "$ipcmd link set $wantphysif address $ho->{Ether}"
 END
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related


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.