From: Hollis Blanchard <hollisb@us.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 6/9] QError: Add qdev not found error
Date: Thu, 15 Oct 2009 13:13:37 -0700 [thread overview]
Message-ID: <1255637617.29192.59.camel@slab.beaverton.ibm.com> (raw)
In-Reply-To: <20091015160839.7dbef5bf@doriath>
On Thu, 2009-10-15 at 16:08 -0300, Luiz Capitulino wrote:
> On Thu, 15 Oct 2009 11:13:53 -0700
> Hollis Blanchard <hollisb@us.ibm.com> wrote:
>
> > On Thu, 2009-10-15 at 14:52 -0300, Luiz Capitulino wrote:
> > >
> > > > You could easily have
> > > > qemu_error(code, "device not found");
> > >
> > > This doesn't solve the problems I mentioned above, besides I don't
> > > see why you need to specify both, the error code and the description,
> > > they describe the same thing.
> >
> > This is how FTP and other protocols work, for example.
>
> I meant in the qemu_error() call, we will certainly emit them both
> in the protocol.
>
> > You supplied a perfect example:
> > qemu_error(404, "husb: host usb device %d.%d is already open\n",
> > bus_num, addr);
> >
> > In this case, an interactive client could only display the "pretty"
> > text.
> >
> > A machine client would interpret the code as Markus described in a
> > previous mail (temporary server error, permanent server error, etc). In
> > case of a permanent server error, the client could *also* pass through
> > the pretty text to display to the user.
>
> Ok, so this design is really different from what I had in mind.
I'm starting to see that. :)
> In your design error codes are more like errors classes, right? So,
> using your example, 404 could have the meaning 'already open, temporary',
> this way it can be used with USB, PCI or even for files.
>
> How do you plan to emit it on the wire? Like this:
>
> { "error": { "code": 404,
> "desc": "husb: host usb device 0.12 is already open" } }
>
> In case I'm right, there are two problems with it:
>
> 1. It's hard to retrieve the variable information
> 2. Maybe minor, but I see too much information for a protocol
I'm really confused by your objections. This is simply HTTP-style
"Status Code" and "Reason
Phrase" (http://tools.ietf.org/html/rfc2616#section-6.1.1) in JSON form.
1. The client receiving the response clearly has a JSON interpreter, so
how is it hard to retrieve anything?
2. Have you ever used software that said "Failed." without explanation?
Unless you're suggesting that all clients would build in their own
code->description tables (I hope to god you're not :), we must transmit
the description in the protocol.
> > Aside from that, we should certainly be able to change the pretty text,
> > for example, to provide additional clarification to the user. The
> > machine-interpreted code, on the other hand, wouldn't change.
>
> How do you plan to do it in the design you're proposing? If you
> use the text from qemu_error() to build the user and protocol
> outputs, then you can't change it.
Today it looks like this:
C: open host USB device foo
S: error 404, host USB device foo is already open
Tomorrow it could look like this:
C: open host USB device foo
S: error 404, host USB device foo is already open by PID 27
As described in HTTP's section 6.1.1:
The Status-Code is intended
for use by automata and the Reason-Phrase is intended for the human
user. The client is not required to examine or display the Reason-
Phrase.
Since the automata only interprets the status code, nothing breaks, and
the user benefits from more information.
--
Hollis Blanchard
IBM Linux Technology Center
next prev parent reply other threads:[~2009-10-15 20:13 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 16:56 [Qemu-devel] [PATCH v0 0/9] QError Luiz Capitulino
2009-10-13 16:56 ` [Qemu-devel] [PATCH 1/9] QDict: Introduce qdict_iter() Luiz Capitulino
2009-10-13 16:56 ` [Qemu-devel] [PATCH 2/9] check-qdict: Add test for qdict_iter() Luiz Capitulino
2009-10-13 16:57 ` [Qemu-devel] [PATCH 3/9] qmisc: Introduce qobject_from_va() Luiz Capitulino
2009-10-13 21:52 ` Markus Armbruster
2009-10-14 13:40 ` Luiz Capitulino
2009-10-14 14:27 ` [Qemu-devel] " Paolo Bonzini
2009-10-13 16:57 ` [Qemu-devel] [PATCH 4/9] Introduce QError Luiz Capitulino
2009-10-13 16:57 ` [Qemu-devel] [PATCH 5/9] monitor: QError support Luiz Capitulino
2009-10-13 21:59 ` Markus Armbruster
2009-10-14 13:14 ` [Qemu-devel] " Paolo Bonzini
2009-10-14 14:07 ` Markus Armbruster
2009-10-13 16:57 ` [Qemu-devel] [PATCH 6/9] QError: Add qdev not found error Luiz Capitulino
2009-10-14 23:02 ` Hollis Blanchard
2009-10-15 13:34 ` Luiz Capitulino
2009-10-15 17:16 ` Hollis Blanchard
2009-10-15 17:52 ` Luiz Capitulino
2009-10-15 18:13 ` Hollis Blanchard
2009-10-15 19:08 ` Luiz Capitulino
2009-10-15 20:13 ` Hollis Blanchard [this message]
2009-10-15 20:57 ` Anthony Liguori
2009-10-15 21:18 ` Hollis Blanchard
2009-10-15 21:27 ` Anthony Liguori
2009-10-15 22:44 ` Hollis Blanchard
2009-10-16 8:06 ` [Qemu-devel] " Paolo Bonzini
2009-10-16 13:05 ` Luiz Capitulino
2009-10-19 10:25 ` Daniel P. Berrange
2009-10-19 12:28 ` Luiz Capitulino
2009-10-19 12:42 ` Daniel P. Berrange
2009-10-16 13:39 ` Anthony Liguori
2009-10-18 4:25 ` [Qemu-devel] " Jamie Lokier
2009-10-18 12:17 ` [Qemu-devel] " Paolo Bonzini
2009-10-19 16:50 ` Hollis Blanchard
2009-10-19 21:16 ` Paolo Bonzini
2009-10-16 7:30 ` [Qemu-devel] " Gerd Hoffmann
2009-10-16 12:39 ` Luiz Capitulino
2009-10-16 13:34 ` [Qemu-devel] " Paolo Bonzini
2009-10-16 13:37 ` [Qemu-devel] " Anthony Liguori
2009-10-16 14:17 ` Luiz Capitulino
2009-10-16 17:28 ` [Qemu-devel] " Paolo Bonzini
2009-10-16 17:47 ` Anthony Liguori
2009-10-16 8:02 ` Paolo Bonzini
2009-10-18 4:28 ` Jamie Lokier
2009-10-18 4:34 ` Jamie Lokier
2009-10-13 16:57 ` [Qemu-devel] [PATCH 7/9] qdev: Use QError for " Luiz Capitulino
2009-10-13 22:34 ` Markus Armbruster
2009-10-14 13:29 ` [Qemu-devel] " Paolo Bonzini
2009-10-14 16:42 ` Luiz Capitulino
2009-10-14 14:51 ` [Qemu-devel] " Luiz Capitulino
2009-10-19 10:12 ` Daniel P. Berrange
2009-10-19 10:40 ` Gerd Hoffmann
2009-10-19 10:47 ` Daniel P. Berrange
2009-10-19 11:22 ` [Qemu-devel] " Paolo Bonzini
2009-10-19 14:00 ` [Qemu-devel] " Anthony Liguori
2009-10-19 15:21 ` Daniel P. Berrange
2009-10-19 15:27 ` Anthony Liguori
2009-10-19 15:39 ` Daniel P. Berrange
2009-10-13 16:57 ` [Qemu-devel] [PATCH 8/9] QError: Add do_info_balloon() errors Luiz Capitulino
2009-10-13 16:57 ` [Qemu-devel] [PATCH 9/9] monitor: do_info_balloon(): use QError Luiz Capitulino
2009-10-15 19:24 ` [Qemu-devel] [PATCH v0 0/9] QError Anthony Liguori
2009-10-15 19:37 ` Luiz Capitulino
2009-10-19 13:13 ` Markus Armbruster
2009-10-19 14:11 ` Anthony Liguori
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=1255637617.29192.59.camel@slab.beaverton.ibm.com \
--to=hollisb@us.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).