From: Stefan Berger Subject: [PATCH] [HOTPLUG] suppress error logging in vTPM hotplug script Date: Tue, 17 Oct 2006 17:00:26 -0400 Message-ID: <1161118826.23289.4.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-9U5N3gE2Zva3JN7997xC" 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 --=-9U5N3gE2Zva3JN7997xC Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-9U5N3gE2Zva3JN7997xC Content-Disposition: attachment; filename=vtpm-hotplug-quiet.diff Content-Type: text/x-patch; name=vtpm-hotplug-quiet.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 @@ -226,7 +226,7 @@ function vtpmdb_remove_entry () { # Returns 'resume' or 'create' function vtpm_get_create_reason () { local resume - resume=$(xenstore-read $XENBUS_PATH/resume) + resume=$(xenstore_read $XENBUS_PATH/resume) if [ "$resume" == "True" ]; then echo "resume" else @@ -287,6 +287,8 @@ function vtpm_create_instance () { #entry is kept in the VTPMDB file. function vtpm_remove_instance () { local instance reason domname + #Stop script execution quietly if path does not exist (anymore) + xenstore-exists "$XENBUS_PATH"/domain domname=$(xenstore_read "$XENBUS_PATH"/domain) if [ "$domname" != "" ]; then @@ -383,7 +385,7 @@ function vtpm_domid_from_name () { local id name ids ids=$(xenstore-list /local/domain) for id in $ids; do - name=$(xenstore-read /local/domain/$id/name) + name=$(xenstore_read /local/domain/$id/name) if [ "$name" == "$1" ]; then echo "$id" return --=-9U5N3gE2Zva3JN7997xC 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 --=-9U5N3gE2Zva3JN7997xC--