qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Andreas Niederl <andreas.niederl@iaik.tugraz.at>
Subject: [Qemu-devel] [PATCH 4/5]: Implement qemu_thread_join function
Date: Thu, 24 Feb 2011 15:05:24 -0500	[thread overview]
Message-ID: <1298577924.17969.5.camel@d941e-10> (raw)
In-Reply-To: <1298576432.17424.1.camel@d941e-10>

This patch provides support for 'joining a thread' by wrapping
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 <stefanb@linux.vnet.ibm.com>

---
 qemu-thread.c |    5 +++++
 qemu-thread.h |    1 +
 2 files changed, 6 insertions(+)

Index: qemu-git/qemu-thread.c
===================================================================
--- qemu-git.orig/qemu-thread.c
+++ qemu-git/qemu-thread.c
@@ -190,3 +190,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
@@ -40,5 +40,6 @@ void qemu_thread_signal(QemuThread *thre
 void qemu_thread_self(QemuThread *thread);
 int qemu_thread_equal(QemuThread *thread1, QemuThread *thread2);
 void qemu_thread_exit(void *retval);
+int qemu_thread_join(QemuThread *thread, void **retval);
 
 #endif

  parent reply	other threads:[~2011-02-24 20:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 19:40 [Qemu-devel] [PATCH 0/5]: Qemu Trusted Platform Module (TPM) integration Stefan Berger
2011-02-24 20:01 ` [Qemu-devel] [PATCH 1/5]: Add tpm_tis driver to build process Stefan Berger
2011-02-24 20:03 ` [Qemu-devel] [PATCH 2/5]: Support for TPM command line options Stefan Berger
2011-02-24 20:04 ` [Qemu-devel] [PATCH 3/5]: Add TPM (frontend) hardware interface (TPM TIS) to Qemu Stefan Berger
2011-02-24 20:05 ` Stefan Berger [this message]
2011-02-24 20:06 ` [Qemu-devel] [PATCH 5/5]: Implementation of the libtpms-based backend Stefan Berger
2011-02-24 20:13 ` [Qemu-devel] [PATCH Appendix] Skeleton backend driver Stefan Berger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298577924.17969.5.camel@d941e-10 \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=andreas.niederl@iaik.tugraz.at \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).