WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xl: Check for dependencies in xl

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: Check for dependencies in xl
From: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxx>
Date: Fri, 14 Jan 2011 13:57:50 -0500
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 14 Jan 2011 10:59:04 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=c7iV8OzXHacTKPrqnQol8BNjesVW2Ia74FpNQ0hpBFY=; b=iLkiZjEBCYMhZ5foa0mxHNtnPPij/WmFi1csjZNyZGLtDuDUCJWX/mG9JQ+LCrvIeY P8D+izBDBLUW6U2UBAaam0nHQsLtB2zVsilDdXXoLpDmDiHb86s4P9k54lGbdpjHt/M7 BytDHV3L5DNfwEwNNGfHO75SZDG0CqinGl6Qs=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ZZFeMhmAx1UU49AEpzsVorXkm7V01xykT417swLMSL1hTs9hH/8Jy6XBrGBmp5lWBI NpovjtSNXgaWUIpCxu4UFWaWRLsMHCPJpTgiG1xsyXS1L4CysMDNKocU9E7zL/aXFPjD 5kkYAHUyQ5gEChA0LZMAA4VC21QlGWJb+RHT0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1295027507.25342.956.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTinm+Y1EE-4zaDyzm8m2gNbzt20MMpb9ypo=Geb9@xxxxxxxxxxxxxx> <1295027507.25342.956.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, Jan 14, 2011 at 12:51 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
>> +
>> +static int check_dependencies(void)
>> +{
>> +    struct xs_handle *xsh;
>> +
>> +    xsh = xs_daemon_open();
>
> This function is deprecated, please use xs_open. In addition this would
> fail if you are running xenstored in a different domain to xl (e.g. a
> stub-xenstored-dom).
>
> Unfortunately the problem with opening a connection to xenstored in a
> way which can cope with a remote xenstored is that it can block
> indefinitely if the other end is not available.
>
> One idea might be to simply check for the xenstored pidfile instead.
> IIRC the prototypes of stub-xenstored also dropped a "domidfile" which
> could also be checked in that case.
>

Will switch to checking for the pid file then.

> Otherwise I suspect the correct fix might involve a fix to
> the /proc/xen/xenbus kernel driver so it doesn't block in this way or
> has a timeout etc.
>
> Perhaps this is more a theoretical concern, since stubdom xenstored
> never really progressed past the prototype stage. It would be nice not
> to add more things which would need fixing up for that case though.
>
>> @@ -103,6 +124,9 @@ int main(int argc, char **argv)
>>          exit(1);
>>      }
>>      opterr = 0;
>> +
>> +    if ( !check_dependencies() )
>> +        exit(1);
>>
>>      logger = xtl_createlogger_stdiostream(stderr, minmsglevel,  0);
>>      if (!logger) exit(1);
>
> The next thing after this xtl_createlogger_stdiostream(...) is a call to
> libxl_ctx_init which will try and open the xenstore in the same way and
> has error logging already so perhaps we should improve on that instead
> of adding a separate check?
>
>

Aren't we making the following assumptions in doing so -

1)  xtl_createlogger_stdiostream would always be the first function
called that uses xenstore.
2)  There aren't likely to be other dependency checks to be added in
future that might warrant a separate function to perform such checks?

Kamala

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel