[virt-tools-list] [virt-viewer][PATCH] virt-viewer: set keepAlive on libvirt connection

Pavel Hrdina phrdina at redhat.com
Tue Jun 30 09:22:19 UTC 2015


Hi Fabiano,

The propose of this diff was to show, that this will resolve that bug.  I could
have send it by myself, but the reason was to let it to virt-viewer developers
to also introduce the possibility to specify the last two arguments of
'virConnectSetKeepAlive' as user may want to use different one.  So instead of
hard-coding some time interval use default values only in case, that user won't
tell otherwise.

Pavel

On Tue, Jun 30, 2015 at 10:27:07AM +0200, Fabiano Fidêncio wrote:
> From: Pavel Hrdina <phrdina at redhat.com>
> 
> Setting the keepAlive on libvirt connection is needed in order to
> receive the CloseCallback event.
> 
> Resolves: rhbz#1164052
> ---
>  src/virt-viewer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> 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;
>  }
>  
> -- 
> 2.4.4
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list




More information about the virt-tools-list mailing list