On 2 May 2014 12:01, Daniel P. Berrange <berra...@redhat.com> wrote: > On Fri, May 02, 2014 at 02:52:23PM +0400, Michael Tokarev wrote: >> Stefan Hajnoczi: >> > +#if !GLIB_CHECK_VERSION(2, 31, 0) >> > +static inline GThread *g_thread_new(const gchar *unused, >> > + GThreadFunc func, >> > + gpointer data) >> > +{ >> > + GThread *thread = g_thread_create(func, data, TRUE, NULL); >> > + if (!thread) { >> > + g_error("g_thread_create failed"); >> > + } >> > + return thread; >> > +} >> > +#endif >> >> About g_error(): >> >> "This function will result in a core dump; don't use it for errors you >> expect. >> Using this function indicates a bug in your program, i.e. an assertion >> failure." >> >> I'm not sure if this is like an assertion failure, probably yes. But we >> should >> not, I think, dump core in this situation. Is there a glib function that >> does >> (fatal) error reporting but does NOT dump core? > > I think that's what g_critical is intended for. It is more severe than > g_warning, but won't exit or abort the process.
I'm not convinced we should be emitting any kind of warning message here anyway -- surely it's up to the caller to handle thread creation failure? The glib warning/error functions presumably print to stderr, which has all the usual issues with possibly messing up guest output. thanks -- PMM