[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 6/9] Implement qemu_thread_join function
From: |
Stefan Berger |
Subject: |
[Qemu-devel] [PATCH V2 6/9] Implement qemu_thread_join function |
Date: |
Wed, 30 Mar 2011 15:42:17 -0400 |
User-agent: |
quilt/0.48-1 |
This patch provides support for 'joining a thread' by wrapping the POSIX
pthread_join with qemu_thread_join.
Since the backend implementation is based on threads and I am stopping
and starting that thread during operations like 'snapshot resume', I
do use this functionality to synchronize with the TPM thread's termination
before terminating the TPM, creating a new one and loading previous state
from the time of the snapshot into the TPM.
Signed-off-by: Stefan Berger <address@hidden>
---
qemu-thread-posix.c | 5 +++++
qemu-thread.h | 1 +
2 files changed, 6 insertions(+)
Index: qemu-git/qemu-thread-posix.c
===================================================================
--- qemu-git.orig/qemu-thread-posix.c
+++ qemu-git/qemu-thread-posix.c
@@ -147,3 +147,8 @@ void qemu_thread_exit(void *retval)
{
pthread_exit(retval);
}
+
+int qemu_thread_join(QemuThread *thread, void **retval)
+{
+ return pthread_join(thread->thread, retval);
+}
Index: qemu-git/qemu-thread.h
===================================================================
--- qemu-git.orig/qemu-thread.h
+++ qemu-git/qemu-thread.h
@@ -35,5 +35,6 @@ void qemu_thread_create(QemuThread *thre
void qemu_thread_get_self(QemuThread *thread);
int qemu_thread_is_self(QemuThread *thread);
void qemu_thread_exit(void *retval);
+int qemu_thread_join(QemuThread *thread, void **retval);
#endif
- [Qemu-devel] [PATCH V2 0/9] Qemu Trusted Platform Module (TPM) integration, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 8/9] Implementation of the libtpms-based backend, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 3/9] Add persistent state handling to TPM TIS frontend driver, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 5/9] Add a debug register, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 1/9] Support for TPM command line options, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 9/9] Add block storage support for libtpms based TPM backend, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 4/9] Add tpm_tis driver to build process, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 7/9] Add a TPM backend skeleton implementation, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 2/9] Add TPM (frontend) hardware interface (TPM TIS) to Qemu, Stefan Berger, 2011/03/30
- [Qemu-devel] [PATCH V2 6/9] Implement qemu_thread_join function,
Stefan Berger <=