Bug 1164052
| Summary: | virt-viewer cannot reconnect libvirtd connection via ssh after libvirtd restart | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | CongDong <codong> | |
| Component: | virt-viewer | Assignee: | Virt Viewer Maint <virt-viewer-maint> | |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | low | |||
| Version: | 7.1 | CC: | cfergeau, dblechte, dyuan, fidencio, juzhou, mzhan, rbalakri, tzheng, xiaodwan, zhwang | |
| Target Milestone: | rc | |||
| Target Release: | 7.2 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | virt-viewer-2.0-4.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1289971 (view as bug list) | Environment: | ||
| Last Closed: | 2015-11-19 07:35:05 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | 1243228, 1246395 | |||
| Bug Blocks: | 1289971 | |||
|
Description
CongDong
2014-11-14 01:31:15 UTC
NB: this is working fine with a connection to a local libvirtd instance. Patch sent to the ML[0]. However, I do not see this bug as a regression what makes me want to avoid having it in for 7.1. [0]: https://www.redhat.com/archives/virt-tools-list/2014-November/msg00095.html (In reply to Fabiano Fidêncio from comment #3) > Patch sent to the ML[0]. However, I do not see this bug as a regression what > makes me want to avoid having it in for 7.1. > > [0]: > https://www.redhat.com/archives/virt-tools-list/2014-November/msg00095.html According to Daniel: "(...) virConnectRegisterCloseCallback should be sufficient to detect when libvirtd goes away. If it isn't working for some cases plesae do report a bug so we can fix it. Apps shouldn't have to play games to infer when libvirtd went away." So, changing this bug from POST to NEW and reassigning it to libvirt. Actually this is not libvirt bug. Moving it back to virt-viewer. This is because of implementation details of SSH protocol. You need to set also keepAlive on the libvirt connection in order to receive the CloseCallback event.
This patch fixes the issue:
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 637b9e4..851c83d 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -960,6 +960,10 @@ virt_viewer_connect(VirtViewerApp *app, GError **err)
g_debug("Unable to register close callback on libvirt connection");
}
+ if (virConnectSetKeepAlive(priv->conn, 5, 3) < 0) {
+ g_debug("Unable to set keep alive");
+ }
+
return 0;
}
But you would like to probably introduce a new option to virt-viewer to let the user to choose, whether he would like to use the keepAlive functionality and to let him chose his own interval and number of retries.
(In reply to Pavel Hrdina from comment #8) > Actually this is not libvirt bug. Moving it back to virt-viewer. This is > because of implementation details of SSH protocol. You need to set also > keepAlive on the libvirt connection in order to receive the CloseCallback > event. > > This patch fixes the issue: > > diff --git a/src/virt-viewer.c b/src/virt-viewer.c > index 637b9e4..851c83d 100644 > --- a/src/virt-viewer.c > +++ b/src/virt-viewer.c > @@ -960,6 +960,10 @@ virt_viewer_connect(VirtViewerApp *app, GError **err) > g_debug("Unable to register close callback on libvirt connection"); > } > > + if (virConnectSetKeepAlive(priv->conn, 5, 3) < 0) { > + g_debug("Unable to set keep alive"); > + } > + > return 0; > } > > > But you would like to probably introduce a new option to virt-viewer to let > the user to choose, whether he would like to use the keepAlive functionality > and to let him chose his own interval and number of retries. Pavel, I'm not sure if this is something we would like to exposeto the users. If no-one complains I will go for your patch. May I ask you to send the patch to virt-tools-list? (Then I won't forget to add you as author and so on ...) (In reply to Fabiano Fidêncio from comment #9) > (In reply to Pavel Hrdina from comment #8) > > Actually this is not libvirt bug. Moving it back to virt-viewer. This is > > because of implementation details of SSH protocol. You need to set also > > keepAlive on the libvirt connection in order to receive the CloseCallback > > event. > > > > This patch fixes the issue: > > > > diff --git a/src/virt-viewer.c b/src/virt-viewer.c > > index 637b9e4..851c83d 100644 > > --- a/src/virt-viewer.c > > +++ b/src/virt-viewer.c > > @@ -960,6 +960,10 @@ virt_viewer_connect(VirtViewerApp *app, GError **err) > > g_debug("Unable to register close callback on libvirt connection"); > > } > > > > + if (virConnectSetKeepAlive(priv->conn, 5, 3) < 0) { > > + g_debug("Unable to set keep alive"); > > + } > > + > > return 0; > > } > > > > > > But you would like to probably introduce a new option to virt-viewer to let > > the user to choose, whether he would like to use the keepAlive functionality > > and to let him chose his own interval and number of retries. > > Pavel, I'm not sure if this is something we would like to exposeto the users. > If no-one complains I will go for your patch. > May I ask you to send the patch to virt-tools-list? (Then I won't > forget to add you as author and so on ...) Okay, I sent the patch as it is, with Pavel as author. Moving it back to virt-viewer. One important info that has been missing about how to reproduce this bug is that the remote host *MUST* be a RHEL-7 or newer. Older versions of libvirt (in the remote host) don't present the keepalive problem, (In reply to Fabiano Fidêncio from comment #22) > Moving it back to virt-viewer. > > One important info that has been missing about how to reproduce this bug is > that the remote host *MUST* be a RHEL-7 or newer. > Older versions of libvirt (in the remote host) don't present the keepalive > problem, Yes, I can reproduce it virt-viewer-0.6.0-11.el7.x86_64 with a RHLE-7 remote host. And the test it with latest virt-viewer, the debug message can display after libvirtd restart. (virt-viewer:19685): virt-viewer-DEBUG: reconnect_poll: 0 (virt-viewer:19685): virt-viewer-DEBUG: Cleanup of handle 0x1661c10 (virt-viewer:19685): virt-viewer-DEBUG: Cleanup of timeout 0x1665f30 (virt-viewer:19685): virt-viewer-DEBUG: Connect timer fired (virt-viewer:19685): virt-viewer-DEBUG: initial connect (virt-viewer:19685): virt-viewer-DEBUG: connecting ... (virt-viewer:19685): virt-viewer-DEBUG: Add handle 10 1 0x1698de0 (virt-viewer:19685): virt-viewer-DEBUG: initial connect So for the original issue, it's fixed. Since this issue has been fixed based on #Comment 23, So move it to verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2211.html |