From: Stefan Berger Subject: [PATCH] [vTPM] Additional vtpm script Date: Thu, 29 Jun 2006 16:26:29 -0400 Message-ID: <1151612789.2804.5.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-GELqLwnTw6oi5ThFNhUD" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel Cc: Ewan Mellor List-Id: xen-devel@lists.xenproject.org --=-GELqLwnTw6oi5ThFNhUD Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-GELqLwnTw6oi5ThFNhUD Content-Disposition: attachment; filename=tpm_script_addtodb.diff Content-Type: text/x-patch; name=tpm_script_addtodb.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 } --=-GELqLwnTw6oi5ThFNhUD Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-GELqLwnTw6oi5ThFNhUD--