# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 2d00d405ef9fe916995f3b0b6cb3d7be65780961
# Parent 761275bcf825fa75f64ac3bbb8748aa1f40c03b8
VTPM Tools: Fix threading bug in vtpm_manager while using NPTL. Now
supports Linux Threads and NPTL threads. Also clean up vtpm Makefile.
Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@xxxxxxxxx>
diff -r 761275bcf825 -r 2d00d405ef9f tools/vtpm/Makefile
--- a/tools/vtpm/Makefile Thu Feb 16 21:33:46 2006
+++ b/tools/vtpm/Makefile Thu Feb 16 21:39:55 2006
@@ -22,10 +22,10 @@
$(MAKE) -C $(VTPM_DIR) $@
clean:
- if [ -d $(TPM_EMULATOR_DIR) ]; \
+ @if [ -d $(TPM_EMULATOR_DIR) ]; \
then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
fi
- if [ -d $(VTPM_DIR) ]; \
+ @if [ -d $(VTPM_DIR) ]; \
then $(MAKE) -C $(VTPM_DIR) clean; \
fi
@@ -57,7 +57,7 @@
patch -p1 <../vtpm.patch
build_sub:
- if [ -e $(GMP_HEADER) ]; then \
+ @if [ -e $(GMP_HEADER) ]; then \
$(MAKE) -C $(VTPM_DIR); \
if [ "$(BUILD_EMULATOR)" = "y" ]; then \
$(MAKE) -C $(TPM_EMULATOR_DIR); \
diff -r 761275bcf825 -r 2d00d405ef9f tools/vtpm_manager/Makefile
--- a/tools/vtpm_manager/Makefile Thu Feb 16 21:33:46 2006
+++ b/tools/vtpm_manager/Makefile Thu Feb 16 21:39:55 2006
@@ -9,7 +9,7 @@
all: build
build:
- if [ -e $(OPENSSL_HEADER) ]; then \
+ @if [ -e $(OPENSSL_HEADER) ]; then \
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done; \
diff -r 761275bcf825 -r 2d00d405ef9f tools/vtpm_manager/manager/Makefile
--- a/tools/vtpm_manager/manager/Makefile Thu Feb 16 21:33:46 2006
+++ b/tools/vtpm_manager/manager/Makefile Thu Feb 16 21:39:55 2006
@@ -24,4 +24,4 @@
# libraries
LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
-LIBS += -lcrypto -lpthread -lrt -lm
+LIBS += -lcrypto -lpthread -lm
diff -r 761275bcf825 -r 2d00d405ef9f tools/vtpm_manager/manager/vtpmd.c
--- a/tools/vtpm_manager/manager/vtpmd.c Thu Feb 16 21:33:46 2006
+++ b/tools/vtpm_manager/manager/vtpmd.c Thu Feb 16 21:39:55 2006
@@ -54,21 +54,15 @@
#ifndef VTPM_MULTI_VM
if (pthread_equal(pthread_self(), vtpm_globals->master_pid)) {
- if (reason >= 0) { // Reason is a signal
- vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal
%d.\n", reason);
- } else {// Reason is a TPM_RESULT * -1
- vtpmloginfo(VTPM_LOG_VTPM,"VTPM Manager shuting down for: %s\n",
tpm_get_error_name(-1 * reason) );
- }
-
- return;
+ vtpmloginfo(VTPM_LOG_VTPM, "VTPM Manager shutting down for signal %d.\n",
reason);
} else {
+ // For old Linux Thread machines, signals are delivered to each thread.
Deal with them.
vtpmloginfo(VTPM_LOG_VTPM, "Child shutting down\n");
pthread_exit(NULL);
}
-#else
+#endif
VTPM_Stop_Service();
exit(-1);
-#endif
}
struct sigaction ctl_c_handler;
@@ -127,8 +121,10 @@
//Join the other threads until exit time.
pthread_join(be_thread, NULL);
pthread_join(dmi_thread, NULL);
-
+#endif
+
+ vtpmlogerror(VTPM_LOG_VTPM, "VTPM Manager shut down unexpectedly.\n");
+
VTPM_Stop_Service();
return 0;
-#endif
}
diff -r 761275bcf825 -r 2d00d405ef9f tools/vtpm_manager/util/log.c
--- a/tools/vtpm_manager/util/log.c Thu Feb 16 21:33:46 2006
+++ b/tools/vtpm_manager/util/log.c Thu Feb 16 21:39:55 2006
@@ -138,5 +138,5 @@
if (code == error_msgs[i].code)
return error_msgs[i].code_name;
- return "Failed to find code name for given code";
+ return("Unknown Error Code");
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|