# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID d095e99392ac77f10449cb78a56f7d133bc0450f
# Parent 5d565bb1278301a27aa42278dcdb9093ab12bd1e
[TPM] Adds a script for virtual TPM support.
It also removes a consistency check from the vtpm-common script file.
Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
tools/python/xen/util/dictio.py | 50 ----------------------------------------
tools/examples/Makefile | 2 -
tools/examples/vtpm-addtodb | 10 ++++++++
tools/examples/vtpm-common.sh | 13 ++--------
4 files changed, 14 insertions(+), 61 deletions(-)
diff -r 5d565bb12783 -r d095e99392ac tools/examples/Makefile
--- a/tools/examples/Makefile Fri Jun 30 10:14:36 2006 +0100
+++ b/tools/examples/Makefile Fri Jun 30 10:16:12 2006 +0100
@@ -26,7 +26,7 @@ XEN_SCRIPTS += network-nat vif-nat
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
diff -r 5d565bb12783 -r d095e99392ac tools/examples/vtpm-common.sh
--- a/tools/examples/vtpm-common.sh Fri Jun 30 10:14:36 2006 +0100
+++ b/tools/examples/vtpm-common.sh Fri Jun 30 10:16:12 2006 +0100
@@ -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
}
diff -r 5d565bb12783 -r d095e99392ac tools/examples/vtpm-addtodb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/examples/vtpm-addtodb Fri Jun 30 10:16:12 2006 +0100
@@ -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 <dom name> <instance number>
+
+dir=$(dirname "$0")
+. "$dir/vtpm-common.sh"
+
+vtpmdb_add_instance $1 $2
diff -r 5d565bb12783 -r d095e99392ac tools/python/xen/util/dictio.py
--- a/tools/python/xen/util/dictio.py Fri Jun 30 10:14:36 2006 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-#===========================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#============================================================================
-# Copyright (C) 2006 International Business Machines Corp.
-# Author: Bryan D. Payne <bdpayne@xxxxxxxxxx>
-#============================================================================
-
-
-def dict_read(dictname, filename):
- """Loads <filename> and returns the dictionary named <dictname> from
- the file.
- """
- dict = {}
-
- # read in the config file
- globs = {}
- locs = {}
- execfile(filename, globs, locs)
-
- for (k, v) in locs.items():
- if k == dictname:
- dict = v
- break
-
- return dict
-
-def dict_write(dict, dictname, filename):
- """Writes <dict> to <filename> using the name <dictname>. If the file
- contains any other data, it will be overwritten.
- """
- prefix = dictname + " = {\n"
- suffix = "}\n"
- fd = open(filename, "wb")
- fd.write(prefix)
- for key in dict:
- line = " '" + str(key) + "': " + str(dict[key]) + ",\n"
- fd.write(line)
- fd.write(suffix)
- fd.close()
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|