[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2] async: aio_context_new(): Handle event_notifier_init failure |
Date: |
Tue, 16 Sep 2014 15:57:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
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