Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-09 Thread Daniel P. Berrange
On Thu, Feb 05, 2009 at 01:57:02PM -0800, john.le...@sun.com wrote: > # HG changeset patch > # User john.le...@sun.com > # Date 1233870902 28800 > # Node ID fe7d1aae6184476568fcd3da379207375d8a05a6 > # Parent 9fecb1254ee1dad6efeedc50239852104a6f40e2 > Improve error reporting in virsh > > Rather t

[libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread john . levon
# HG changeset patch # User john.le...@sun.com # Date 1233870902 28800 # Node ID fe7d1aae6184476568fcd3da379207375d8a05a6 # Parent 9fecb1254ee1dad6efeedc50239852104a6f40e2 Improve error reporting in virsh Rather than verbosely printing every error, save the last error and report that only if the

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread John Levon
On Thu, Feb 05, 2009 at 08:39:55PM +, Daniel P. Berrange wrote: > > First, we'd need to make some changes to the libvirtd because it calls > > into a number of APIs, both public entry points & some of the internal > > helpers directly, but does not reset the error in betweeen these calls. > >

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread Daniel P. Berrange
On Thu, Feb 05, 2009 at 08:37:29PM +, Daniel P. Berrange wrote: > On Thu, Feb 05, 2009 at 06:09:10PM +, John Levon wrote: > > > > In contrast, "only set an error if one isn't set already" is simple, > > immediately understandable, and covers almost all the common cases. > > I'm not totall

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread Daniel P. Berrange
On Thu, Feb 05, 2009 at 06:09:10PM +, John Levon wrote: > On Thu, Feb 05, 2009 at 05:34:20PM +, Daniel P. Berrange wrote: > > Just have the virXendError macro call virReportErrorHelper directly, > > as it already does - there is no need to wrap it in the conditional > > check 'if(virGetLa

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread John Levon
On Thu, Feb 05, 2009 at 08:20:28PM +, Daniel P. Berrange wrote: > This actually still leaks the char * strings associated with the > error - we probably need to now add a virErrorFree() function to > go along with the new virSaveError function. Yep, working on two new patches. Sorry about tha

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread Daniel P. Berrange
On Thu, Feb 05, 2009 at 11:28:48AM -0800, john.le...@sun.com wrote: > # HG changeset patch > # User john.le...@sun.com > # Date 1233859425 28800 > # Node ID c594c1c54b88947082a01b6aaa81ad7756bbd951 > # Parent a23da778e0ddf954d8bf0a185b508fc236feb4be > Improve error reporting in virsh > > Rather t

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread John Levon
On Thu, Feb 05, 2009 at 11:28:48AM -0800, john.le...@sun.com wrote: > Improve error reporting in virsh > > Rather than verbosely printing every error, save the last error and > report that only if the entire command fails. This version fixes up the memory leak issue Dan spotted. It's dependent u

[libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread john . levon
# HG changeset patch # User john.le...@sun.com # Date 1233859425 28800 # Node ID c594c1c54b88947082a01b6aaa81ad7756bbd951 # Parent a23da778e0ddf954d8bf0a185b508fc236feb4be Improve error reporting in virsh Rather than verbosely printing every error, save the last error and report that only if the

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread John Levon
On Thu, Feb 05, 2009 at 05:34:20PM +, Daniel P. Berrange wrote: > Ok, how about a slightly different virSaveLastError() call, avoiding > the need to do the pair of call virGetLastEror() + virCloneError() Sounds reasonable to me. > > > Also, it is neccessary to free the error message/object >

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread Daniel P. Berrange
On Thu, Feb 05, 2009 at 05:05:53PM +, John Levon wrote: > On Thu, Feb 05, 2009 at 12:34:32PM +, Daniel P. Berrange wrote: > > > > +static void > > > +virshReportError(vshControl *ctl) > > > +{ > > > +if (last_error == NULL) > > > +return; > > > + > > > +if (last_error->code

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread John Levon
On Thu, Feb 05, 2009 at 12:34:32PM +, Daniel P. Berrange wrote: > > +static void > > +virshReportError(vshControl *ctl) > > +{ > > +if (last_error == NULL) > > +return; > > + > > +if (last_error->code == VIR_ERR_OK) { > > +vshError(ctl, TRUE, "%s", _("unknown error"));

Re: [libvirt] [PATCH] Improve error reporting in virsh

2009-02-05 Thread Daniel P. Berrange
On Wed, Feb 04, 2009 at 03:56:26PM -0800, john.le...@sun.com wrote: > # HG changeset patch > # User john.le...@sun.com > # Date 1233791330 28800 > # Node ID 6588879d8cc9a3af1147a5edd624aee5155493ae > # Parent da162569b5f7e132c4ccbfc56fc3670fb5ecee10 > Improve error reporting in virsh > > Rather t

[libvirt] [PATCH] Improve error reporting in virsh

2009-02-04 Thread john . levon
# HG changeset patch # User john.le...@sun.com # Date 1233791330 28800 # Node ID 6588879d8cc9a3af1147a5edd624aee5155493ae # Parent da162569b5f7e132c4ccbfc56fc3670fb5ecee10 Improve error reporting in virsh Rather than verbosely printing every error, save the last error and report that only if the