qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 1/1] modules: Improve error message when module is not fou


From: Claudio Fontana
Subject: Re: [PATCH v2 1/1] modules: Improve error message when module is not found
Date: Fri, 23 Jul 2021 10:04:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

On 7/23/21 8:25 AM, Gerd Hoffmann wrote:
>   Hi,
> 
>> --- a/accel/accel-softmmu.c
>> +++ b/accel/accel-softmmu.c
>> @@ -79,7 +79,10 @@ void accel_init_ops_interfaces(AccelClass *ac)
>>       * all accelerators need to define ops, providing at least a mandatory
>>       * non-NULL create_vcpu_thread operation.
>>       */
>> -    g_assert(ops != NULL);
>> +    if (ops == NULL) {
> 
> Error message here?> Also split accel bits into a separate patch?

If ops is NULL there is something seriously wrong with the code assumptions.
Asserts are in my view the proper way to handle these.

I do not think there is any reason to change this.

> 
>>          g_hash_table_remove(loaded_modules, module_name);
>> +        fprintf(stderr, "%s module is missing, install the "
>> +                        "package or config the library path "
>> +                        "correctly.\n", module_name);
> 
> This should be error_report(), or maybe warn_report() as this
> isn't a fatal error in all cases.  Otherwise looks good to me.
> 
> take care,
>   Gerd
> 




reply via email to

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