[Pkg-xen-devel] [PATCH 09/13] xen init script: move init_dom0 into xenstored start

Hans van Kranenburg hans at knorrie.org
Sun Feb 10 23:42:07 GMT 2019


This little xen-init-dom0 program is present in both our 4.8 and 4.11
packages, so there's no need to keep the if else code. Also, it only
makes sense to run it after starting xenstored, and not all other times
start is called.

xen-init-dom0 is a C program that by the way does exactly those two
writes into xenstore.
---
 debian/xen-utils-common.xen.init | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/debian/xen-utils-common.xen.init b/debian/xen-utils-common.xen.init
index f736b9a17c..748c1cfc0a 100644
--- a/debian/xen-utils-common.xen.init
+++ b/debian/xen-utils-common.xen.init
@@ -269,17 +269,9 @@ xenstored_start()
 	if ! [ $time -lt $timeout ] ; then
 	    return 2
 	fi
-}
 
-init_dom0()
-{
-	log_progress_msg "init-dom0"
-	if [ -e $ROOT/bin/xen-init-dom0 ] ; then
-	    $ROOT/bin/xen-init-dom0 > /dev/null
-	else
-	    xenstore-write "/local/domain/0/name" "Domain-0"
-	    xenstore-write "/local/domain/0/domid" "0"
-	fi
+	# Add some extra entries about dom0 into xenstore
+	$ROOT/bin/xen-init-dom0 > /dev/null
 }
 
 case "$1" in
@@ -307,11 +299,6 @@ case "$1" in
 		0|1) ;;
 		*) log_end_msg 1; exit ;;
 	esac
-	init_dom0
-	case "$?" in
-		0|1) ;;
-		*) log_end_msg 1; exit ;;
-	esac
 	qemu_start
 	case "$?" in
 		0|1) ;;
-- 
2.20.1




More information about the Pkg-xen-devel mailing list