Index: root/xen-unstable.hg/tools/examples/Makefile =================================================================== --- root.orig/xen-unstable.hg/tools/examples/Makefile +++ 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 Index: root/xen-unstable.hg/tools/examples/vtpm-addtodb =================================================================== --- /dev/null +++ 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 + +dir=$(dirname "$0") +. "$dir/vtpm-common.sh" + +vtpmdb_add_instance $1 $2 Index: root/xen-unstable.hg/tools/examples/vtpm-common.sh =================================================================== --- root.orig/xen-unstable.hg/tools/examples/vtpm-common.sh +++ 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 }