From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
stefanb@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH] tests: fix tpm-crb tpm-tis tests race
Date: Fri, 16 Mar 2018 14:25:03 +0000 [thread overview]
Message-ID: <20180316142503.GM3066@redhat.com> (raw)
In-Reply-To: <20180316142223.28745-1-marcandre.lureau@redhat.com>
On Fri, Mar 16, 2018 at 03:22:23PM +0100, Marc-André Lureau wrote:
> 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>
> ---
> tests/tpm-emu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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);
Won't this leave an orphaed FD open in the test suite ? Is it perhaps
sufficient to just swap the order of the g_thread_join and qio_channel_close
calls, so that we join the thread before we close the channel that the
thread is using ?
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2018-03-16 14:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-16 14:22 [Qemu-devel] [PATCH] tests: fix tpm-crb tpm-tis tests race Marc-André Lureau
2018-03-16 14:25 ` Daniel P. Berrangé [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2018-05-08 15:29 Stefan Berger
2018-05-08 15:30 ` Daniel P. Berrangé
2018-05-31 17:28 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=20180316142503.GM3066@redhat.com \
--to=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.