From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert \(git\)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, kraxel@redhat.com,
mst@redhat.com, qemu-trivial@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 2/4] HMP: Prepend errors with 'Error:'
Date: Thu, 14 Feb 2019 10:53:58 +0100 [thread overview]
Message-ID: <87o97eae6h.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190212134758.10514-3-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 12 Feb 2019 13:47:56 +0000")
"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> writes:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Always make error messages start with 'Error:' as a fallback
> to make sure that anything parsing them can tell it failed.
Feeding HMP output to programs is a bad idea to begin with.
> Note: Some places don't use hmp_handle_error
True. A more honest subject would be "HMP: Prepend some errors with
'Error:'".
Several distinct reasons for not using hmp_handle_error():
* Handling an error that isn't transmitted as an Error object
HMP command handlers generally wrap around QMP command handlers, which
always use Error objects. Still, there are other sources of errors
when the HMP command does more than the wrapped QMP command (typically
convenience features for humans), or there is no wrapped QMP command.
* Augmenting the error message
Reporting with error_reportf_err() is easier than first messing with
the Error object, then passing it to hmp_handle_error(). Example:
hmp_delvm().
* hmp_handle_error() is static, and we're outside hmp.c
Tolerable as long as hmp_handle_error() is trivial. Your patch makes
it a bit less trivial.
If we truly want to "Prepend errors with 'Error:'", then we should make
hmp command handlers take an Error ** argument, and leave the reporting
to the HMP core.
If you think prepending some errors is useful (and I guess you do), go
right ahead with this patch. I'd recommend to use the more honest
subject, though.
WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, kraxel@redhat.com,
mst@redhat.com, qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] HMP: Prepend errors with 'Error:'
Date: Thu, 14 Feb 2019 10:53:58 +0100 [thread overview]
Message-ID: <87o97eae6h.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190212134758.10514-3-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 12 Feb 2019 13:47:56 +0000")
"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> writes:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Always make error messages start with 'Error:' as a fallback
> to make sure that anything parsing them can tell it failed.
Feeding HMP output to programs is a bad idea to begin with.
> Note: Some places don't use hmp_handle_error
True. A more honest subject would be "HMP: Prepend some errors with
'Error:'".
Several distinct reasons for not using hmp_handle_error():
* Handling an error that isn't transmitted as an Error object
HMP command handlers generally wrap around QMP command handlers, which
always use Error objects. Still, there are other sources of errors
when the HMP command does more than the wrapped QMP command (typically
convenience features for humans), or there is no wrapped QMP command.
* Augmenting the error message
Reporting with error_reportf_err() is easier than first messing with
the Error object, then passing it to hmp_handle_error(). Example:
hmp_delvm().
* hmp_handle_error() is static, and we're outside hmp.c
Tolerable as long as hmp_handle_error() is trivial. Your patch makes
it a bit less trivial.
If we truly want to "Prepend errors with 'Error:'", then we should make
hmp command handlers take an Error ** argument, and leave the reporting
to the HMP core.
If you think prepending some errors is useful (and I guess you do), go
right ahead with this patch. I'd recommend to use the more honest
subject, though.
next prev parent reply other threads:[~2019-02-14 9:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 13:47 [Qemu-trivial] [PATCH 0/4] a few trivials Dr. David Alan Gilbert (git)
2019-02-12 13:47 ` [Qemu-devel] " Dr. David Alan Gilbert (git)
2019-02-12 13:47 ` [Qemu-trivial] [PATCH 1/4] pckbd: Convert DPRINTF->trace Dr. David Alan Gilbert (git)
2019-02-12 13:47 ` [Qemu-devel] " Dr. David Alan Gilbert (git)
2019-02-12 14:10 ` [Qemu-trivial] " Philippe Mathieu-Daudé
2019-02-12 14:10 ` Philippe Mathieu-Daudé
2019-02-14 9:54 ` [Qemu-trivial] " Laurent Vivier
2019-02-14 9:54 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-02-12 13:47 ` [Qemu-trivial] [PATCH 2/4] HMP: Prepend errors with 'Error:' Dr. David Alan Gilbert (git)
2019-02-12 13:47 ` [Qemu-devel] " Dr. David Alan Gilbert (git)
2019-02-12 14:11 ` [Qemu-trivial] " Philippe Mathieu-Daudé
2019-02-12 14:11 ` Philippe Mathieu-Daudé
2019-02-14 9:53 ` Markus Armbruster [this message]
2019-02-14 9:53 ` Markus Armbruster
2019-02-14 9:55 ` [Qemu-trivial] " Laurent Vivier
2019-02-14 9:55 ` [Qemu-devel] " Laurent Vivier
2019-02-12 13:47 ` [Qemu-trivial] [PATCH 3/4] kvm: Add kvm_set_ioeventfd* traces Dr. David Alan Gilbert (git)
2019-02-12 13:47 ` [Qemu-devel] " Dr. David Alan Gilbert (git)
2019-02-12 14:12 ` [Qemu-trivial] " Philippe Mathieu-Daudé
2019-02-12 14:12 ` Philippe Mathieu-Daudé
2019-02-12 14:41 ` [Qemu-trivial] " Cornelia Huck
2019-02-12 14:41 ` Cornelia Huck
2019-02-12 13:47 ` [Qemu-trivial] [PATCH 4/4] wavcapture: Convert to error_report Dr. David Alan Gilbert (git)
2019-02-12 13:47 ` [Qemu-devel] " Dr. David Alan Gilbert (git)
2019-02-14 9:58 ` [Qemu-trivial] " Laurent Vivier
2019-02-14 9:58 ` [Qemu-devel] " Laurent Vivier
2019-02-14 10:01 ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
2019-02-14 10:01 ` Markus Armbruster
2019-02-12 14:05 ` [Qemu-trivial] [PATCH 0/4] a few trivials Michael S. Tsirkin
2019-02-12 14:05 ` [Qemu-devel] " Michael S. Tsirkin
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=87o97eae6h.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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.