All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH] qapi: make machine type deprecation a warning
Date: Thu, 12 May 2022 10:26:08 +0200	[thread overview]
Message-ID: <a1d20baf-03de-d567-50d9-3c58080699a2@redhat.com> (raw)
In-Reply-To: <871qwzdi3r.fsf@pond.sub.org>

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.

Paolo

> The commit only changes the message printed to stderr.  The commit
> message made me expect it would change an actual (fatal?) error into a
> mere warning.  It's too late in my day to come up with a clearer
> phrasing, so
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 
> 



  reply	other threads:[~2022-05-12  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 17:50 [PATCH] qapi: make machine type deprecation a warning Paolo Bonzini
2022-05-11 18:44 ` Markus Armbruster
2022-05-12  8:26   ` Paolo Bonzini [this message]
2022-05-12  9:44     ` Markus Armbruster
2022-05-12 10:46 ` Markus Armbruster
2022-05-12 12:24   ` Paolo Bonzini
2022-05-12 12:53     ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1d20baf-03de-d567-50d9-3c58080699a2@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.