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: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: Check for dependencies in xl
From: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxx>
Date: Thu, 20 Jan 2011 09:10:54 -0500
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 20 Jan 2011 06:12:06 -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=fefOFY/319niy2hMqlgazDHMYzkhOcrytxT5tZpvjJw=; b=IYUWR7rM38oU7W32JH8fkvJWGv2or0D5n4uj3SHMwNiWw8hiDtbd16mvykFqtFO4GS ia9Tvt+Fd82MMc1LjoQ3tP8jXIjJGANgmwN+99ddb9IOoJTFyD8M2Dv9i4JY3Oub0ETG tKaLcigknpwoE9mFEvBYSsUwWz9dYFmvraTKM=
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=FE0QAtqq9CrWDTSkcIfeT033aoyeZVIi9qKpEq67epKYQDNCsioOq/VD7pNAJ4ccZb A0cn7Rfw/Hc2DMa5qOAQdQYDTcM6S7t8EXasNo9S46k67cpUXK5FAUjbvw2ZfqONtmEM CY1B3uOIEwr7E/9BDAaf/hnPldVcAMM1hPxVc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1101201100440.7277@kaball-desktop>
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> <AANLkTinH1t-Mc3nr+k-cabYhxw5z3rOBwAFMde3CJBKF@xxxxxxxxxxxxxx> <alpine.DEB.2.00.1101201100440.7277@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
My preference would to use static const over preprocessor definitions
but I also don't mind conformance if that is why you are suggesting
this change.

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       Thu Jan 20 08:58:06 2011 -0500
@@ -40,11 +40,20 @@

 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) {
diff -r fe8a177ae9cb tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Wed Jan 19 15:29:04 2011 +0000
+++ b/tools/libxl/libxl_internal.h      Thu Jan 20 08:58:06 2011 -0500
@@ -104,6 +104,7 @@ typedef struct {
 #define AUTO_PHP_SLOT          0x100
 #define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
 #define SYSFS_PCIBACK_DRIVER   "/sys/bus/pci/drivers/pciback"
+#define XENSTORE_PID_FILE      "/var/run/xenstore.pid"

 #define PROC_PCI_NUM_RESOURCES 7
 #define PCI_BAR_IO             0x01

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel