[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xl: Check for dependencies in xl
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |