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

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


  • To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.