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;

Paolo

Reply via email to