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

Re: [Libvir] Patch to 'ping' XenD when opening connection



On Mon, Jun 12, 2006 at 04:01:33PM +0100, Daniel P. Berrange wrote:
> Currently the XenD driver's implementation of the 'open' method will return
> success, regardless of whether XenD is even present. The attached patch
> makes the open method do a 'ping' to see if XenD is actually there, returning
> failure if it is not. This ensures that the XenD driver backend doesn't get
> activated when connecting to alternate non-Xen backends, such as the test
> backend I committed last week.  

  Yes that makes sense. I think originally the point was to be able to start 
some monitoring tool before xend was started (and it's simpler) but now
this need fixing, you are right.

> The current 'ping' is simply to call the xenDaemonGetVersion() method since
> that's a pretty simle & low-overhead way to testing livliness of XenD. Any
> suggestions for a better ping - if not I'll go ahead & commit this change 
[...]
> +    /* A sort of "ping" to make sure the daemon is actually
> +       alive & well, rather than just assuming it is */
> +    if ((ret = xenDaemonGetVersion(conn, &version)) < 0) {

   hum, it seems the connection should be closed in that error case, or
we may be leaking. Not 100% since I don't have the full context right now.
Once checked, yes please commit :-)

> +      return ret;
> +    }
>  
>  /*    return(xenDaemonOpen_unix(conn, "/var/lib/xend/xend-socket")); */

 thanks !

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


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