qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>,
	qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 00/10]: QError v4
Date: Fri, 20 Nov 2009 13:04:52 -0600	[thread overview]
Message-ID: <4B06E854.7080101@codemonkey.ws> (raw)
In-Reply-To: <m3zl6hc9ts.fsf@crossbow.pond.sub.org>

Markus Armbruster wrote:
> We have:
>
> (1) machine-readable error code
>
> (2) human-readable error message
>
> (3) machine-readable additional error data
>
> The old monitor prints just (3).
>   

s:(3):(2):

> You propose to have QMP send (1) and (3).  This forces all clients to
> come up with (2) themselves.  Why that's problematic is discussed
> elsewhere in this thread.
>   

As I said else where, sending (2) along with (1) and (3) doesn't bother 
me.  It's whether (2) is generated automatically from (1) and (2) or 
whether within qemu, the caller who creates the error supplies that text 
free hand.  That's what I'm fundamentally opposed to.

> Imagine we already had a QMP that sent (1) and (2), encoded in JSON.
> Then nothing could stop you to add a "data" part holding (3).

If (2) is generated from (1) based on a table, then I agree with you.  
If (2) is open coded, then I disagree fundamentally because you're 
mixing in information from (3) in there.

>   Ergo,
> keeping things simple by sending just (1) and (2) now does not make it
> impossible to send (3) later, hence does not make it impossible to
> provide your important feature in a future iteration.
>   

Let me give a concrete example of where your logic falls apart.  Say you 
start out with:

qemu_error_new(QERR_DEVICE_NOT_READY, "Ballooning is not enabled in the 
guest");

And somewhere else you have:

qemu_error_new(QERR_DEVICE_NOT_READY, "The virtio-net driver is not 
loaded in the guest");

There is no way to unify these into a coherent message.  It's forever 
free form and the there will always be additional information in the 
description that requires parsing from a client.  This is obviously more 
complicated for the client.  It's also impossible to internationalize 
effectively because even if you introduce a data field, you aren't 
passing enough information to generate these messages.  In this case, 
it's a subtle case of grammatical mismatch although both messages are 
saying the exact same thing.

>> 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.
>>     
>
> What do you mean by versioning change?  And what does it mean for
> clients?
>   

We really haven't gotten into versioning/feature negotation, but in my 
mind, if we add a new error type for a function, that's the same as 
adding an additional argument.  It's a new feature that requires some 
sort of version/feature mechanism.

>> My basic concerns boil down to:
>>
>> 1) It must be possible to support localization from the very beginning
>>     
>
> If you insist on supporting localization in the client right now,
> despite costs & risks, there's nothing I can do, and nothing more for me
> to say on my first concern (QMP overengineered for a first iteration of
> the protocol).
>   

Your proposal makes it impossible forever so yes, it's a hard 
requirement.  I'm making a lot of attempts to meet you half way but if 
your argument is "I don't like this, it's too complicated, I don't care 
about localization" then I don't think we're going to get over that.

Regards,

Anthony Liguori

  reply	other threads:[~2009-11-20 19:05 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
2009-11-20 18:47         ` Markus Armbruster
2009-11-20 19:04           ` Anthony Liguori [this message]
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=4B06E854.7080101@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).