All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>, xen-devel@lists.xensource.com
Subject: Re: Re: Error reporting capabilities for libxc
Date: Mon, 23 Oct 2006 22:48:50 +0100	[thread overview]
Message-ID: <20061023214850.GM25795@redhat.com> (raw)
In-Reply-To: <453D366E.5020201@us.ibm.com>

On Mon, Oct 23, 2006 at 04:38:54PM -0500, Anthony Liguori wrote:
> Daniel P. Berrange wrote:
> >On Mon, Oct 23, 2006 at 04:14:59PM -0500, Anthony Liguori wrote:
> >  
> >>Ian Pratt wrote:
> >>    
> >>>Would we be better off returning an error code and a set of parameters,
> >>>requiring a call-back into the library to get the string? 
> >>>
> >>>It's worth thinking about future language localisation here too.
> >>> 
> >>>      
> >>I know it's a bigger patch, but the Right Thing to do here is to just 
> >>propagate an error code through the libxc functions.
> >>
> >>The whole xc_{get,set}_error() is a cludge.  Threading wouldn't be a 
> >>problem if we returned proper error codes.
> >>    
> >
> >This would be an insufficient level of detail compared to my patch. An 
> >error
> >code alone can tell you there was an invalid kernel, or even particular 
> >tests
> >which failed. It can *not* tell you that when the architecture mis-matched,
> >the expected arch was 'i386' and the actual arch was 'x86_64'. Hence why
> >I provided both an error code & a detailed message. 
> >
> >Notice in the following there are two strings - 'Invalid kernel' is the
> >string associated with the error code 'XC_INVALID_KERNEL'. This is the
> >generic static mapping. The second string though is dynamically generated
> >according to the specific metadata which was incorrect - this is the 
> >invaluable user facing information which cuts down on debugging pain.
> >  
> 
> stdout from libxenctrl gets redirected to the Xend logs.  You could 
> write this sort of info to the logs.

Where is it utterly inaccessible for any applications talking to XenD.

> I don't know of many users that will be able to make sense out of the 
> following lines.  How many users know what an "ELF architecture" is that 
> wouldn't be capable of looking in log file?

You don't neccessarily show that level of detail to the user, but it is
important to propagate it all the way back to the tools talking to libxc
or Xend. xm, or libvirt, or virt-manager, or any other tool talking to
XenD should have access to this kind of debugging info. If I'm doing
off-box management of hosts & a domain create operation fails, I don't
want to have to login to the box in question to get this information
out of the xend logs, when xend could quite easily have passed it all
back over the wire in the first place.

> If a user passes an invalid kernel line in the config, I think an 
> appropriate error would be "Kernel <filename> is not a valid Xen kernel."
> 
> That's pretty clear and understandable.  This message is totally 
> reproducible in xm with just an XC_INVALID_KERNEL error code.

It really depends on the end user in question. If the information is 
available, an API should pass it back to the applicationxs to decide what
level of detail is appropriate to present. We shouldn't encode the 
error reporting policy in the API itself, because it has no idea of the
needs of the caller.  

BTW, when I say 'user' i mean caller of the (Xend) APIs (ie applications), 
rather than human operators.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

  parent reply	other threads:[~2006-10-23 21:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 12:58 Error reporting capabilities for libxc Ian Pratt
2006-09-26 13:20 ` Daniel P. Berrange
2006-10-23 18:00 ` Daniel P. Berrange
2006-10-23 19:17   ` Anthony Liguori
2006-10-23 19:27     ` Daniel P. Berrange
2006-10-23 20:04       ` Anthony Liguori
2006-10-23 20:08         ` Daniel P. Berrange
2006-10-23 20:54       ` Ian Pratt
2006-10-23 20:57         ` Daniel P. Berrange
2006-10-23 21:10           ` Ian Pratt
2006-10-23 21:14             ` Anthony Liguori
2006-10-23 21:28               ` Daniel P. Berrange
2006-10-23 21:38                 ` Anthony Liguori
2006-10-23 21:47                   ` John Levon
2006-10-24  9:15                     ` Daniel Veillard
2006-10-23 21:48                   ` Daniel P. Berrange [this message]
2006-10-24  7:47               ` Gerd Hoffmann
2006-10-24  9:07                 ` Keir Fraser
2006-10-24 10:26                   ` Gerd Hoffmann
2006-10-23 21:21             ` Daniel P. Berrange
2006-10-23 22:15               ` Ian Pratt
2006-10-23 23:05                 ` Daniel P. Berrange
2006-10-23 20:40   ` John Levon
2006-10-23 21:04   ` John Levon
2006-10-23 21:09     ` Daniel P. Berrange

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=20061023214850.GM25795@redhat.com \
    --to=berrange@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /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.