ia64/xen-unstable

changeset 11891:f247e0b52dda

[TPM] Check the existence of the xenstore path before trying to read from it.
This prevents an error from being logged. Use the wrapped command for
reading from the xenstore instead of the native one.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author kfraser@localhost.localdomain
date Wed Oct 18 18:37:18 2006 +0100 (2006-10-18)
parents 71e2a165aa7f
children 1e8ba8d21175
files tools/examples/vtpm-common.sh
line diff
     1.1 --- a/tools/examples/vtpm-common.sh	Wed Oct 18 18:35:21 2006 +0100
     1.2 +++ b/tools/examples/vtpm-common.sh	Wed Oct 18 18:37:18 2006 +0100
     1.3 @@ -226,7 +226,7 @@ function vtpmdb_remove_entry () {
     1.4  # Returns 'resume' or 'create'
     1.5  function vtpm_get_create_reason () {
     1.6  	local resume
     1.7 -	resume=$(xenstore-read $XENBUS_PATH/resume)
     1.8 +	resume=$(xenstore_read $XENBUS_PATH/resume)
     1.9  	if [ "$resume" == "True" ]; then
    1.10  		echo "resume"
    1.11  	else
    1.12 @@ -287,6 +287,8 @@ function vtpm_create_instance () {
    1.13  #entry is kept in the VTPMDB file.
    1.14  function vtpm_remove_instance () {
    1.15  	local instance reason domname
    1.16 +	#Stop script execution quietly if path does not exist (anymore)
    1.17 +	xenstore-exists "$XENBUS_PATH"/domain
    1.18  	domname=$(xenstore_read "$XENBUS_PATH"/domain)
    1.19  
    1.20  	if [ "$domname" != "" ]; then
    1.21 @@ -383,7 +385,7 @@ function vtpm_domid_from_name () {
    1.22  	local id name ids
    1.23  	ids=$(xenstore-list /local/domain)
    1.24  	for id in $ids; do
    1.25 -		name=$(xenstore-read /local/domain/$id/name)
    1.26 +		name=$(xenstore_read /local/domain/$id/name)
    1.27  		if [ "$name" == "$1" ]; then
    1.28  			echo "$id"
    1.29  			return