WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Update the TPM hotplug scripts to determine the reason o

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Update the TPM hotplug scripts to determine the reason of a
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 06 Feb 2006 18:00:09 +0000
Delivery-date: Mon, 06 Feb 2006 18:11:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID bf176086255baefd27f223a9a5b88c27896fa7ce
# Parent  6f7c5439a6c49e0f74b673e8d7863365075086be
Update the TPM hotplug scripts to determine the reason of a
device creation (create/resume).

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

diff -r 6f7c5439a6c4 -r bf176086255b tools/examples/vtpm
--- a/tools/examples/vtpm       Fri Feb  3 19:30:54 2006
+++ b/tools/examples/vtpm       Sat Feb  4 09:58:28 2006
@@ -5,16 +5,16 @@
 
 
 case "$command" in
-    online | offline)
-        exit 0
-        ;;
-esac
-
-case "$command" in
   add)
     vtpm_create_instance
   ;;
+  online)
+    vtpm_create_instance
+  ;;
   remove)
+    vtpm_remove_instance
+  ;;
+  offline)
     vtpm_remove_instance
   ;;
 esac
diff -r 6f7c5439a6c4 -r bf176086255b tools/examples/vtpm-common.sh
--- a/tools/examples/vtpm-common.sh     Fri Feb  3 19:30:54 2006
+++ b/tools/examples/vtpm-common.sh     Sat Feb  4 09:58:28 2006
@@ -219,6 +219,17 @@
 }
 
 
+# Find the reason for the creation of this device:
+# Set global REASON variable to 'resume' or 'create'
+function get_create_reason () {
+       local resume=$(xenstore-read $XENBUS_PATH/resume)
+       if [ "$resume" == "True" ]; then
+               REASON="resume"
+       else
+               REASON="create"
+       fi
+}
+
 #Create a vTPM instance
 # If no entry in the TPM database is found, the instance is
 # created and an entry added to the database.
@@ -226,6 +237,7 @@
        local domname=$(xenstore_read "$XENBUS_PATH"/domain)
        local res
        set +e
+       get_create_reason
        find_instance $domname
        res=$?
        if [ $res -eq 0 ]; then
@@ -243,7 +255,7 @@
                add_instance $domname $instance
                if [ "$REASON" == "create" ]; then
                        vtpm_create $instance
-               elif [ "$REASON" == "hibernate" ]; then
+               elif [ "$REASON" == "resume" ]; then
                        vtpm_resume $instance $domname
                else
                        #default case for 'now'
@@ -252,11 +264,12 @@
        fi
        if [ "$REASON" == "create" ]; then
                vtpm_reset $instance
-       elif [ "$REASON" == "hibernate" ]; then
+       elif [ "$REASON" == "resume" ]; then
                vtpm_setup $instance
        else
                #default case for 'now'
-               vtpm_reset $instance
+               #vtpm_reset $instance
+               true
        fi
        xenstore_write $XENBUS_PATH/instance $instance
        set -e
@@ -273,7 +286,7 @@
                #Something is really wrong with the DB
                log err "vTPM DB file $VTPMDB has no entry for '$domname'"
        else
-               if [ "$REASON" == "hibernate" ]; then
+               if [ "$REASON" == "suspend" ]; then
                        vtpm_suspend $instance
                fi
        fi

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Update the TPM hotplug scripts to determine the reason of a, Xen patchbot -unstable <=