Public virErrorPreserveLast()/virErrorRestore()

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

 



These two functions are currently private to libvirt, hence not available to
consumers. Would it be possible to make them public? Without them, there's no
way to do any libvirt call without stomping on an existing error that you may
want to preserve.

I have multiple threads sharing a remote connection (to local libvirtd). I need
to be able to handle connection drops (e.g. libvirtd restart). Long story short,
the only approach I've found that actually works properly is that there's one
main conn object, each thread has a virConnectRef() to it, and whenever a thread
gets an error, we check in the error callback if !virConnectIsAlive(). If so, we
close the thread's conn, and potentially also clean up the main conn.

Then when the error gets returned from the relevant library call, we try to
re-connect.

However, virConnectIsAlive() stomps on the thread's error, meaning we lose the
context on a real, non-connection-related error.

So I need to be able to save and restore in the error handler.

Given how much these are used inside libvirt code already, it feels likely it
would be useful in other public cases too.

Thoughts?

thnaks
john
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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]

  Powered by Linux