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