On 11/04/2018 11:35, Peter Xu wrote: > Yeah, the inheritance will only make sure cur_mon be initialized > always with correct value just like when we are without Out-Of-Band. > For example, it's still possible a thread is created within a QMP > handler. If without current change, the cur_mon in the new thread > would be NULL. > > AFAIU even if cur_mon==NULL we should mostly be fine (e.g., > error_vprintf will handle that case well). If any of you can help me > confirm this, then I agree that this patch is not really needed.
Yes, though the solution is to not use error_vprintf from auxiliary threads. :) Just make sure all the communication happens through a struct that's passed in the thread entry point, and possibly bottom halves from the auxiliary thread to the monitor iothread. Paolo > If so, maybe even we don't need to setup cur_mon at entry of monitor > iothread, since cur_mon is always used in the way like: