On Fri, Mar 16, 2018 at 09:45:59AM -0400, Stefan Berger wrote: > On 03/16/2018 09:41 AM, Marc-André Lureau wrote: > > Hi > > > > On Fri, Mar 16, 2018 at 2:37 PM, Marc-André Lureau > > <marcandre.lur...@gmail.com> wrote: > > > Hi > > > > > > On Fri, Mar 16, 2018 at 2:27 PM, Daniel P. Berrangé <berra...@redhat.com> > > > wrote: > > > > At least the tpm_emu_tpm_thread() there is only something in the test > > > > suite, so the real system emulator code isn't at risk of crashing. > > > > > > > > Feels like the thread simply should *not* use error_abort, and instead > > > > have a more graceful way to exit when the socket closes > > > > > > > The code expects the read() to return 0 on disconnect, not an error. > > > Apparently this works on !osx. Should we adapt qio-channel-socket to > > > return 0 in this case on osx too? > > Oh I see, it calls close() on the same end, that's not correct. I > > wonder if shutdown would be better. Other suggestions? > > > We could send the thread a special message, like 0xff ff ff ff, and that > terminates it...
If there's no resource cleanup in this test suite thread to worry about could just pthread_cancel() it 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 :|