| Summary: | [RFE] return VIR_ERR_INVALID_CONN whenever a broken connection is used | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Dan Kenigsberg <danken> |
| Component: | libvirt | Assignee: | Daniel Veillard <veillard> |
| Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.2 | CC: | berrange, bsarathy, eblake, jdenemar, xen-maint |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-05-26 17:46:11 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Dan Kenigsberg
2011-03-03 15:09:20 UTC
VIR_ERR_INVALID_CONN is specifically for case where the pointer address is not valid, but adding a new code is of course possible.
The hard bit though is that the codepaths involved are pretty long & convoluted, and much of it is shared code. So changing the error codes reported in one scenario, may negatively effect error codes in a different scenario.
There is work upstream to re-write some of the RPC code, which could let you check using the 'err->domain == VIR_FROM_RPC' rather than 'err->code == VIR_ERR_INVALID_CONN'. But even check VIR_FROM_RPC and then closing + reopening would have potential for false-positives. Perhaps if we added a virConnectPing() API which was a no-op, aside from validating connectivity
eg, so if you do something like
if err->domain == VIR_FROM_RPC
if (!virConnectPing())
...re-reconnect...
FWIW, current virt-manager code does this
except libvirt.libvirtError, e:
if (e.get_error_domain() == libvirt.VIR_FROM_REMOTE and
e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR):
logging.exception("Could not refresh connection %s." % uri)
logging.debug("Closing connection since libvirtd "
"appears to have stopped.")
In the future that will need to check VIR_FROM_RPC too.
|