Additional vtpm script
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.
Signed-off-by Stefan Berger <[email protected]>
xen-unstable.hg/tools/examples/Makefile +1 -1
@@ -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
@@ -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
@@ -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