[libvirt] [PATCH] (failed) virConnectOpenAuth: Add VIR_CONNECT_NO_DEFAULT_ERROR_HANDLER flag.

Richard W.M. Jones rjones at redhat.com
Mon Oct 15 07:43:44 UTC 2012


On Sun, Oct 14, 2012 at 07:57:02PM -0400, Cole Robinson wrote:
> On 10/14/2012 01:52 PM, Richard W.M. Jones wrote:
> > 
> > Well, it was a good idea, but the patch doesn't work.  Apparently
> > along their open paths, drivers don't set errors in the newly created
> > handle, but in the global handler instead (hence the errors still get
> > printed to stderr).
> > 
> 
> Can you give an example of the error you are seeing?

I was one of the libssh errors, I don't have the exact text.

> I don't think I've ever
> experienced that issue with virt-install/virt-manager. You can use
> virSetErrorFunc before getting a virConnect handle.

You can do this in a program, but not in a library (like libguestfs)
because it changes the global handler, which the program using the
library might not be happy about.

Doing it on a thread-local basis might work, but AFAICT from the
source, only the error messages (not the handler) are thread-local.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the libvir-list mailing list