From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, kraxel@redhat.com,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 00/10]: QError v4
Date: Fri, 20 Nov 2009 10:13:03 -0600 [thread overview]
Message-ID: <4B06C00F.3020107@codemonkey.ws> (raw)
In-Reply-To: <m38we27rju.fsf@crossbow.pond.sub.org>
Markus Armbruster wrote:
>> It's highly likely that for this last case, you'd want generic code to
>> generate this error. Further more, in order to generate the error
>> message for a user, you need to know what device does not have a
>> functioning driver. You may say it's obvious for something like info
>> balloon but it's not so obvious if you assume we support things other
>> than just virtio-pci-balloon. For instance, with s390, it's a
>> different balloon driver. For xenner/xenpv, it's a different driver.
>> It really suggests we should send the qdev device name for the current
>> balloon driver.
>>
>
> This is your argument for structured error reporting. It boils down to
> client localization.
>
> I challenge the idea that we should even try to get that covered now.
> We need to get the basics right, and the only way to do that is to use
> them in anger. The more baggage we design into the thing before we use
> it, the higher the risk that we screw it up.
>
Current proposal is:
qemu_error_new(QERR_DEVICE_NOT_FOUND, "00:11:22");
Alternative proposal[1]:
qemu_error_new(QERR_DEVICE_NOT_FOUND, "Could not find PCI device 00:11:22");
Alternative proposal[2]:
qemu_error_new(QERR_DEVICE_NOT_FOUND);
Your argument has merit if you're countering with [2]. [1] is incorrect
because it makes localization impossible. This isn't an evolutionary
feature, this is a hard requirement as far as I'm concerned. At least
[2] allows localization.
I dislike [2] though because it means that our errors are not going to
be able to be generic enough. I really want the information of which
device was not found to be part of the error message.
>> I've described my requirements for what a client can do. I'd like to
>> understand how you disagree.
>>
>
> I have essentially two complaints:
>
> * I'm afraid we've made QError much more complex than it need be (item 1
> above), at least for a first iteration of the protocol.
>
> * The design has shortcomings that effectively require clients to know
> all errors (items 2 & 3 above).
>
My main concern is that we're making an important feature impossible.
If we're arguing for errno style errors verses structured exceptions, I
think that's a more reasonable argument. I'm really concerned about the
long term ramifications about combining errno style errors with free
formed, non-localized text error messages.
>> I would never pass an error string from a third party directly to a
>> user. I doubt you'll find a lot of good applications that do. From a
>> usability perspective, you need to be in control of your interactions
>> with the user. They grammar needs to be consistent and it has to be
>> localized. The best you would do with a third party string is log it
>> to some log file for later examination by support. In that case,
>> dumping the class code and the supporting information in JSON form is
>> just as good as a text description.
>>
>
> How should the application report an error it doesn't know to the user?
>
An error it doesn't know about is a bug in the application. Adding a
new type of error to a monitor function is equivalent to changing it's
behavior. It should require a versioning change.
>>> If we later realize that this solution was *too* stupid, we can simply
>>> add a data member to the error object.
>>>
>>>
>> It's never that easy because a management tool has to support a least
>> common denominator.
>>
>
> If we build complex solutions for anticipated needs, we run a high risk
> of missing real needs. And then we'll evolve the protocol "sideways",
> which is even less easy for management tools than evolving "upwards".
>
> We'll iterate anyway, so why not embrace it? Start with something
> simple and functional, then extend it to address what's found lacking.
>
I'm not arguing for a mythical use-case that could come in five years.
This is something I want to support right now.
My basic concerns boil down to:
1) It must be possible to support localization from the very beginning
2) Client developers should not have to parse an english language,
subject to change, string in order to get more information about an
error. IOW, the error object should always produce the same descriptive
message regardless of where or how it's generated as long as it's fields
are equal.
For 2, there are two ways to do this: have an error message table based
on error codes with no structured data or have an error template table
based on error codes and a dictionary of optional data.
The later is a superset of the former so it seems to be really obvious
to start with the later.
Regards,
Anthony Liguori
next prev parent reply other threads:[~2009-11-20 16:13 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 19:43 [Qemu-devel] [PATCH 00/10]: QError v4 Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 01/10] QJSON: Introduce qobject_from_jsonv() Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 02/10] QString: Introduce qstring_append_chr() Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 03/10] QString: Introduce qstring_append_int() Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 04/10] QString: Introduce qstring_from_substr() Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 05/10] utests: Add qstring_append_chr() unit-test Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 06/10] utests: Add qstring_from_substr() unit-test Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 07/10] Introduce QError Luiz Capitulino
2009-11-18 15:16 ` Markus Armbruster
2009-11-18 17:23 ` Luiz Capitulino
2009-11-19 8:42 ` Markus Armbruster
2009-11-19 12:59 ` [Qemu-devel] " Paolo Bonzini
2009-11-18 18:14 ` [Qemu-devel] " Daniel P. Berrange
2009-11-18 19:58 ` Anthony Liguori
2009-11-18 20:13 ` Luiz Capitulino
2009-11-17 19:43 ` [Qemu-devel] [PATCH 08/10] monitor: QError support Luiz Capitulino
2009-11-18 15:16 ` Markus Armbruster
2009-11-18 17:29 ` Luiz Capitulino
2009-11-18 18:16 ` Daniel P. Berrange
2009-11-17 19:43 ` [Qemu-devel] [PATCH 09/10] qdev: Use QError for 'device not found' error Luiz Capitulino
2009-11-18 15:17 ` Markus Armbruster
2009-11-18 17:32 ` Luiz Capitulino
2009-11-20 7:23 ` Amit Shah
2009-11-17 19:43 ` [Qemu-devel] [PATCH 10/10] monitor: do_info_balloon(): use QError Luiz Capitulino
2009-11-18 15:17 ` Markus Armbruster
2009-11-18 15:58 ` Anthony Liguori
2009-11-18 18:10 ` Luiz Capitulino
2009-11-18 16:06 ` [Qemu-devel] [PATCH 00/10]: QError v4 Markus Armbruster
2009-11-18 18:08 ` Anthony Liguori
2009-11-19 2:36 ` Jamie Lokier
2009-11-20 15:56 ` Anthony Liguori
2009-11-20 16:20 ` Luiz Capitulino
2009-11-20 16:27 ` Anthony Liguori
2009-11-20 17:57 ` Markus Armbruster
2009-11-20 17:29 ` Markus Armbruster
2009-11-20 17:37 ` Anthony Liguori
2009-11-19 10:11 ` Markus Armbruster
2009-11-20 16:13 ` Anthony Liguori [this message]
2009-11-20 18:47 ` Markus Armbruster
2009-11-20 19:04 ` Anthony Liguori
2009-11-21 10:02 ` Markus Armbruster
2009-11-22 16:08 ` Anthony Liguori
2009-11-23 13:06 ` Luiz Capitulino
2009-11-23 13:11 ` Anthony Liguori
2009-11-23 13:34 ` Luiz Capitulino
2009-11-23 13:50 ` Alexander Graf
2009-11-24 11:55 ` Luiz Capitulino
2009-11-24 12:13 ` Alexander Graf
2009-11-23 16:08 ` Markus Armbruster
2009-11-23 12:42 ` Luiz Capitulino
2009-11-23 16:15 ` Markus Armbruster
2009-11-18 18:13 ` [Qemu-devel] " Paolo Bonzini
2009-11-19 10:25 ` Markus Armbruster
2009-11-19 13:01 ` Paolo Bonzini
2009-11-19 14:11 ` Markus Armbruster
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=4B06C00F.3020107@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=armbru@redhat.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).