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;
+ }
ctx->xch = xc_interface_open(lg,lg,0);
if (!ctx->xch) {
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|