[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xl: Check for dependencies in xl
On Wed, 2011-01-19 at 18:46 +0000, Kamala Narasimhan wrote: > Revised patch based on your comments. Please let me know if there are > further suggestions. > > Signed-off-by: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxxx> > > Kamala > > diff -r fe8a177ae9cb tools/libxl/libxl.c > --- a/tools/libxl/libxl.c Wed Jan 19 15:29:04 2011 +0000 > +++ b/tools/libxl/libxl.c Wed Jan 19 13:42:24 2011 -0500 > @@ -38,13 +38,24 @@ > > #define PAGE_TO_MEMKB(pages) ((pages) * 4) > > +static char const xenstore_pid_file[] = "/var/run/xenstore.pid"; > + > int libxl_ctx_init(libxl_ctx *ctx, int version, xentoollog_logger *lg) > { > + struct stat stat_buf; > + > if (version != LIBXL_VERSION) > return ERROR_VERSION; > memset(ctx, 0, sizeof(libxl_ctx)); > ctx->lg = lg; > memset(&ctx->version_info, 0, sizeof(libxl_version_info)); > + > + if ( stat(xenstore_pid_file, &stat_buf) != 0 ) { > + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, > + "Is xenstore daemon running?\nStat on file %s returned - > \"%s\".\n", > + xenstore_pid_file, strerror(errno)); > + return ERROR_FAIL; > + } NAK Actually I think this type of check should go after the xenstore open has failed, just as an informational/hint type of thing IF it fails. Rather than applying what is really a heuristic and making it CAUSE a failure. Gianni _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |