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

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> 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 ;-)

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]