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: Perform minimal validation of virtual disk f

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual disk file while parsing config file
From: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxx>
Date: Mon, 24 Jan 2011 09:31:44 -0500
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 24 Jan 2011 06:32:37 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=neSYHdywl9L2bHsTEhQ5JUlOkPvBtXmf+hPmeOBqdrs=; b=DVlXL2dJXwK5I/2qUSIRkBu1WB79IHu/cfLV9lhNZvfOKpJS/oXcd6WRQhF7/J1CVH a9qbf1k/0GJevhX2LB+cRw/0vZoxZqJV/ohelj9TJIMhTEK25/P/PP5gKdRxUwK5C652 gY9NUFOtfS0vxr1+9hL2Euv+pOF1v8phAsxzA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=h3KyFXpyG8Y6jxhjml9PD2WfCQBTtkVmD813k6YzGxEZXw6YWby7pqYQSxd1iXx2L2 TrzI69ARld7nHhxsg0WxdpbWA3mJBZHcS7LTeKrIEnx5Yx8IYvsPDKBZaUXLcL0JBxHf r4Y+SEKN3oNabLgSAIwwqf08wPkZz7FUvsamQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D3D8A19.6020603@xxxxxxxxx>
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: <AANLkTimSUym0u+SNm0AvNp3AZQQFspetAaXmNShkPJd4@xxxxxxxxxxxxxx> <1294995912.8240.86.camel@xxxxxxxxxxxxxxxxxxxxxx> <AANLkTikfUHHc+-gVkgnRJc722wObLF3TumpK5WSfJVAE@xxxxxxxxxxxxxx> <1295024348.12018.222.camel@xxxxxxxxxxxxxxxxxxxxxx> <AANLkTikf3TVJwE_N-OyuS-UhyA8+cgzAG__9hz3AETeM@xxxxxxxxxxxxxx> <AANLkTinJ=PYsC6vbPvU8g2T8NmyohLa=4rd9zfhTMCCO@xxxxxxxxxxxxxx> <AANLkTin1AGxH26158mn37_Oar1PgSSJoJOnGHs+XnxsV@xxxxxxxxxxxxxx> <1295532296.12018.337.camel@xxxxxxxxxxxxxxxxxxxxxx> <19768.22912.878633.622270@xxxxxxxxxxxxxxxxxxxxxxxx> <AANLkTinnrmAxaOVu1fN2qt4N2t-EzpF31sKE-Jpn-y2f@xxxxxxxxxxxxxx> <AANLkTi=1b+amdCA4A3AKxAnR6C65xv2+O3BNbGsp-T7i@xxxxxxxxxxxxxx> <19769.31094.274199.464586@xxxxxxxxxxxxxxxxxxxxxxxx> <4D3D8A19.6020603@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.24 (X11/20101027)
BTW, the below patch is for checking dependencies in xl.  I should have 
responded to "[Xen-devel] [PATCH] xl: Check for dependencies in xl" thread 
instead.  I already sent the disk validation patch.

Kamala

Kamala Narasimhan wrote:
> I am resending this with tweaks though I am not sure if you plan to accept it 
> for 4.1.  Hopefully there is no word wrapping issues etc.
> 
> 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       Sun Jan 23 12:42:21 2011 -0500
> @@ -40,11 +40,19 @@
> 
>  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_ERRNO(ctx, LIBXL__LOG_ERROR, "Is xenstore daemon 
> running?\n"
> +                     "failed to stat %s", XENSTORE_PID_FILE);
> +        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      Sun Jan 23 12:42:21 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