* [PATCH] qapi: make machine type deprecation a warning
@ 2022-05-11 17:50 Paolo Bonzini
2022-05-11 18:44 ` Markus Armbruster
2022-05-12 10:46 ` Markus Armbruster
0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2022-05-11 17:50 UTC (permalink / raw)
To: qemu-devel
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);
}
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] qapi: make machine type deprecation a warning
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
2022-05-12 10:46 ` Markus Armbruster
1 sibling, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2022-05-11 18:44 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, Thomas Huth
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".
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] qapi: make machine type deprecation a warning
2022-05-11 18:44 ` Markus Armbruster
@ 2022-05-12 8:26 ` Paolo Bonzini
2022-05-12 9:44 ` Markus Armbruster
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2022-05-12 8:26 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, Thomas Huth
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>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] qapi: make machine type deprecation a warning
2022-05-12 8:26 ` Paolo Bonzini
@ 2022-05-12 9:44 ` Markus Armbruster
0 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2022-05-12 9:44 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, Thomas Huth
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!
[...]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] qapi: make machine type deprecation a warning
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 10:46 ` Markus Armbruster
2022-05-12 12:24 ` Paolo Bonzini
1 sibling, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2022-05-12 10:46 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Commit message nitpick: not sure this is "qapi:". The commit that
introduced "Machine type ... is deprecated" (08fe68244eb) used
"hw/i386:". We commonly use "vl:", "softmmu:", and "softmmu/vl:" for
this file.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] qapi: make machine type deprecation a warning
2022-05-12 10:46 ` Markus Armbruster
@ 2022-05-12 12:24 ` Paolo Bonzini
2022-05-12 12:53 ` Daniel P. Berrangé
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2022-05-12 12:24 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel
On 5/12/22 12:46, Markus Armbruster wrote:
> Commit message nitpick: not sure this is "qapi:". The commit that
> introduced "Machine type ... is deprecated" (08fe68244eb) used
> "hw/i386:". We commonly use "vl:", "softmmu:", and "softmmu/vl:" for
> this file.
Will do.
I wonder if I should already propose renaming vl.c to climain.c, even if
there's no qmpmain.c yet. Emotional/historical attachment is probably
not good enough of a reason to keep that name.
I suppose this is already a proposal.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] qapi: make machine type deprecation a warning
2022-05-12 12:24 ` Paolo Bonzini
@ 2022-05-12 12:53 ` Daniel P. Berrangé
0 siblings, 0 replies; 7+ messages in thread
From: Daniel P. Berrangé @ 2022-05-12 12:53 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Markus Armbruster, qemu-devel
On Thu, May 12, 2022 at 02:24:35PM +0200, Paolo Bonzini wrote:
> On 5/12/22 12:46, Markus Armbruster wrote:
> > Commit message nitpick: not sure this is "qapi:". The commit that
> > introduced "Machine type ... is deprecated" (08fe68244eb) used
> > "hw/i386:". We commonly use "vl:", "softmmu:", and "softmmu/vl:" for
> > this file.
>
> Will do.
>
> I wonder if I should already propose renaming vl.c to climain.c, even if
> there's no qmpmain.c yet. Emotional/historical attachment is probably not
> good enough of a reason to keep that name.
>
> I suppose this is already a proposal.
For all the othe tools we just use the filename $TOOL.c, eg qemu-img.c,
etc. So what about qemu-system.c
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-05-12 12:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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é
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.