[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Unify most error reporting (ver 2)



On Fri, Oct 10, 2008 at 03:16:09PM +0200, Jim Meyering wrote:
> Jim Meyering <jim meyering net> wrote:
> 
> > "Daniel P. Berrange" <berrange redhat com> wrote:
> > ...
> >> Some parts of qemu supply it, many other parts do not since they
> >> have no access to the virDomainPtr object. This is one of the
> >> reasons for deprecating this field - it was impossible to reliably
> >> provide it when raising errors.
> >>
> >> In this particular test case error, we are better off supplying the
> >> domain name in the format string - it'll improve the error message
> >> to have it placed in context of the description
> >>
> >> eg, instead of
> >>
> >>  libvir: Test error test: internal error Domain is still running
> >>
> >>
> >> We'd have
> >>
> >>  libvir: Test error: internal error Domain 'test' is still running
> >>
> >> Which could be done by changing
> >>
> >>     if (privdom->state != VIR_DOMAIN_SHUTOFF) {
> >>         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
> >>                   _("Domain is still running"));
> >>
> >>
> >> to be
> >>
> >>     if (privdom->state != VIR_DOMAIN_SHUTOFF) {
> >>         testError(domain->conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
> >>                   _("Domain '%s' is still running"), domain->name);
> >
> > Yep.  I began doing that about 15 minutes ago ;-)
> 
> Here's the change to adjust src/test.c.
> Two change sets:
>   - Fix the "make check" failure by adjusting uses of testError,
>   including domain->name (and a few net->name) strings via format.
>   - Remove now-ignored dom and net parameters.

ACK, these both look good.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]