qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-stable@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] tests: fix tpm-crb tpm-tis tests race
Date: Thu, 31 May 2018 13:28:49 -0400	[thread overview]
Message-ID: <10f6e1a1-ad16-9877-4b71-14b9cc46a58f@linux.vnet.ibm.com> (raw)

Please apply the following commit to QEMU 2.12:


commit 7647d5c6b5e3b3f36a6e0441c81ae3fe797eb233
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Tue May 8 11:29:35 2018 -0400

     tests: fix tpm-crb tpm-tis tests race

     No need to close the TPM data socket on the emulator end, qemu will
     close it after a SHUTDOWN. This avoids a race between close() and
     read() in the TPM data thread.

     Reported-by: Peter Maydell <peter.maydell@linaro.org>
     Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
     Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
     Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
     Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/tests/tpm-emu.c b/tests/tpm-emu.c
index 4dada76834..8c2bd53cad 100644
--- a/tests/tpm-emu.c
+++ b/tests/tpm-emu.c
@@ -125,7 +125,7 @@ void *tpm_emu_ctrl_thread(void *data)
          case CMD_SHUTDOWN: {
              ptm_res res = 0;
              qio_channel_write(ioc, (char *)&res, sizeof(res), 
&error_abort);
-            qio_channel_close(s->tpm_ioc, &error_abort);
+            /* the tpm data thread is expected to finish now */
              g_thread_join(s->emu_tpm_thread);
              break;
          }


             reply	other threads:[~2018-05-31 17:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 17:28 Stefan Berger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-08 15:29 [Qemu-devel] [PATCH] tests: fix tpm-crb tpm-tis tests race Stefan Berger
2018-05-08 15:30 ` Daniel P. Berrangé
2018-03-16 14:22 Marc-André Lureau
2018-03-16 14:25 ` Daniel P. Berrangé
2018-03-16 14:29   ` Marc-André Lureau
2018-03-16 14:30     ` Daniel P. Berrangé
2018-03-16 14:40       ` Stefan Berger
2018-05-18 16:12 ` Alex Bennée

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=10f6e1a1-ad16-9877-4b71-14b9cc46a58f@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).