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@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: Check for dependencies in xl
From: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxx>
Date: Wed, 19 Jan 2011 13:46:34 -0500
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 19 Jan 2011 10:48:02 -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; bh=2qSgwpitM4tzVusqexcDy9tTFJExEb/CtrXHzuZX/xA=; b=BhCukVWa5H5Hn8zOAWwcnFmk8v0jmnJDYDDZNe02L7rt5EIzSFi+G/1KiFwfzsakTo 0qghPzwFywENojqOb1iAMd8WGuFHobvi95AkBF0IgXF5hT6mUpJHCMaJk0jLbceXxXgu YJ55CKhq/KvFNjtTLuVRdpVnE7UMCg6VzIXfA=
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; b=BH8xw7KAWtop7JpV97sdW9ZA6LPcx4a8zzfeU4s3orS8kRX8rxWPlqjD3Jv3o6rE/Y JUGcDU+dQyU+/vorev2J19UjpN+GkLDaUiDOvSETxlPD8H38xuVVK6RYxy3vdeiGPMrJ +3hTHjy0kHY35Ha6W3Zey3/LK6623sjSnhHBA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=B-WgKZRemBh9Z_OL_mNjZyfpBokuVC-xQ2Y_d@xxxxxxxxxxxxxx>
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> <AANLkTimEu-and-4aaMUn+snhxS=cViKWweH6Jnbxpv10@xxxxxxxxxxxxxx> <1295032746.12280.110.camel@xxxxxxxxxxxxxxxxxxxxx> <AANLkTi=B-WgKZRemBh9Z_OL_mNjZyfpBokuVC-xQ2Y_d@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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