Skip to contentSkip to conversation

Additional vtpm script

PATCH New Stefan Berger 1 participant 1 message Jun 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Additional vtpm script

This patch adds a script for virtual TPM support. It also removes a consistency check from the vtpm-common script file.

xen-unstable.hg/tools/examples/Makefile +1 -1
Index: root/xen-unstable.hg/tools/examples/Makefile
===================================================================
@@ -26,7 +26,7 @@ XEN_SCRIPTS += network-route vif-route
 XEN_SCRIPTS += network-nat vif-nat
 XEN_SCRIPTS += block
 XEN_SCRIPTS += block-enbd block-nbd
-XEN_SCRIPTS += vtpm vtpm-delete
+XEN_SCRIPTS += vtpm vtpm-delete vtpm-addtodb
 XEN_SCRIPTS += xen-hotplug-cleanup
 XEN_SCRIPTS += external-device-migrate
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
xen-unstable.hg/tools/examples/vtpm-addtodb new file +10 -0
Index: root/xen-unstable.hg/tools/examples/vtpm-addtodb
===================================================================
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# This script must be called with the following parameters to have
+# an entry added to the TPM-to-domain associations table in /etc/xen/vtpm.db
+# vtpm-addtodb <dom name> <instance number>
+
+dir=$(dirname "$0")
+. "$dir/vtpm-common.sh"
+
+vtpmdb_add_instance $1 $2
xen-unstable.hg/tools/examples/vtpm-common.sh +3 -10
Index: root/xen-unstable.hg/tools/examples/vtpm-common.sh
===================================================================
@@ -347,16 +347,9 @@ function isLocalAddress() {
 # 2nd: name of the domain to migrate
 # 3rd: the migration step to perform
 function vtpm_migration_step() {
-	local instance res
-	instance=$(vtpmdb_find_instance $2)
-	if [ "$instance" == "" ]; then
-		echo "Error: Translation of domain name ($2) to instance failed. Check /etc/xen/vtpm.db"
-		log err "Error during translation of domain name"
-	else
-		res=$(isLocalAddress $1)
-		if [ "$res" == "0" ]; then
-			vtpm_migrate $1 $2 $3
-		fi
+	local res=$(isLocalAddress $1)
+	if [ "$res" == "0" ]; then
+		vtpm_migrate $1 $2 $3
 	fi
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel