qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] async: aio_context_new(): Handle event_notif


From: Chrysostomos Nanakos
Subject: Re: [Qemu-devel] [PATCH v2] async: aio_context_new(): Handle event_notifier_init failure
Date: Tue, 16 Sep 2014 18:43:30 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Sep 16, 2014 at 03:57:25PM +0200, Paolo Bonzini wrote:
> Il 16/09/2014 15:53, Benoît Canet ha scritto:
> >>  static void iothread_complete(UserCreatable *obj, Error **errp)
> >> >  {
> >> > +    Error *local_error = NULL;
> >> >      IOThread *iothread = IOTHREAD(obj);
> >> >  
> >> >      iothread->stopping = false;
> >> > -    iothread->ctx = aio_context_new();
> >> > +    iothread->ctx = aio_context_new(&local_error);
> >> > +    if (!iothread->ctx) {
> >> > +        error_report("%s", error_get_pretty(local_error));
> >> > +        error_report("Failed to create AIO context");
> > I think reporting one line is sufficient.
> > 
> > You could do something in the vein of.
> > error_report("Failed to create AIO Context: \'%s\'", 
> > error_get_pretty(local_error));
> > 
> > 
> >> > +        exit(1);
> > Also here I don't know if exiting in the middle of a class initialization
> > completion function is good taste.
> > You should ask to someone knowing QOM.
> > 
> 
> Indeed, the right thing to do is simply
> 
>     error_propagate(errp, local_error);
>     return;
Just to note that after propagating the error and returning, QEMU fails
silently without printing the error message.

I will make the proposed changes and try to resolve this in the next patch
series if this is possible.


Regards,
Chrysostomos.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]