Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-05 Thread Paolo Bonzini
On 04/07/2016 21:53, Gerd Hoffmann wrote: > Hi, > What about graphics threads ? In particular I'd be thinking of spice which uses threads and chardevs. >>> >>> I think it should be quiesced after pause_all_vcpus returns. Marc-André >>> should know, but it's better to check with Gerd

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Gerd Hoffmann
Hi, > > > What about graphics threads ? In particular I'd be thinking of spice > > > which uses threads and chardevs. > > > > I think it should be quiesced after pause_all_vcpus returns. Marc-André > > should know, but it's better to check with Gerd. > > In theory, spice_server_vm_stop() shou

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Daniel P. Berrange
On Mon, Jul 04, 2016 at 06:43:42PM +0200, Marc-André Lureau wrote: > Hi > > On Mon, Jul 4, 2016 at 6:31 PM, Daniel P. Berrange > wrote: > > On Mon, Jul 04, 2016 at 05:38:23PM +0200, marcandre.lur...@redhat.com wrote: > >> From: Marc-André Lureau > >> > >> It turns out qemu is calling exit() in

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Marc-André Lureau
Hi - Original Message - > > > On 04/07/2016 19:07, Daniel P. Berrange wrote: > > > At this point you have stopped all CPUs and block devices. There is not > > > much else that is going on in QEMU at all, at this point. The solution > > > would be to stop those threads. > > > > What ab

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Paolo Bonzini
On 04/07/2016 19:07, Daniel P. Berrange wrote: > > At this point you have stopped all CPUs and block devices. There is not > > much else that is going on in QEMU at all, at this point. The solution > > would be to stop those threads. > > What about graphics threads ? In particular I'd be thinki

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Daniel P. Berrange
On Mon, Jul 04, 2016 at 06:46:47PM +0200, Paolo Bonzini wrote: > > > On 04/07/2016 18:31, Daniel P. Berrange wrote: > >> > Instead of using a atexit() handler, only run the chardev cleanup as > >> > initially proposed at the end of main(), where there are less chances > >> > (hic) of conflicts or

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Paolo Bonzini
On 04/07/2016 18:31, Daniel P. Berrange wrote: >> > Instead of using a atexit() handler, only run the chardev cleanup as >> > initially proposed at the end of main(), where there are less chances >> > (hic) of conflicts or other races. > This doesn't really seem all that much safer. There's still

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Marc-André Lureau
Hi On Mon, Jul 4, 2016 at 6:31 PM, Daniel P. Berrange wrote: > On Mon, Jul 04, 2016 at 05:38:23PM +0200, marcandre.lur...@redhat.com wrote: >> From: Marc-André Lureau >> >> It turns out qemu is calling exit() in various places from various >> threads without taking much care of resources state.

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Daniel P. Berrange
On Mon, Jul 04, 2016 at 05:38:23PM +0200, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > It turns out qemu is calling exit() in various places from various > threads without taking much care of resources state. The atexit() > cleanup handlers cannot easily destroy resources that

Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler

2016-07-04 Thread Paolo Bonzini
On 04/07/2016 17:38, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > It turns out qemu is calling exit() in various places from various > threads without taking much care of resources state. The atexit() > cleanup handlers cannot easily destroy resources that are in use (by > t