[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual disk file while parsing config file
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |