qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] qapi: make machine type deprecation a warning


From: Markus Armbruster
Subject: Re: [PATCH] qapi: make machine type deprecation a warning
Date: Thu, 12 May 2022 11:44:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 5/11/22 20:44, Markus Armbruster wrote:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>> 
>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>> ---
>>>   softmmu/vl.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/softmmu/vl.c b/softmmu/vl.c
>>> index c2919579fd..fbef0f5c5f 100644
>>> --- a/softmmu/vl.c
>>> +++ b/softmmu/vl.c
>>> @@ -3723,7 +3723,7 @@ void qemu_init(int argc, char **argv, char **envp)
>>>         machine_class = MACHINE_GET_CLASS(current_machine);
>>>       if (!qtest_enabled() && machine_class->deprecation_reason) {
>>> -        error_report("Machine type '%s' is deprecated: %s",
>>> +        warn_report("Machine type '%s' is deprecated: %s",
>>>                        machine_class->name, 
>>> machine_class->deprecation_reason);
>>>       }
>>
>> Anti-pattern: error_report() not followed by "fail function".
>
> Good point, thanks for writing it down... That's what I couldn't put
> my fingers on (hence the scant commit message).  I'll augment the
> commit message with the following:
>
> error_report should generally be followed by a failure; if we can
> proceed anyway, that is just a warning and should be communicated
> properly to the user with warn_report.

Good!

[...]




reply via email to

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