From: Ian Jackson Subject: Re: Using "xl create" without domain config file Date: Wed, 6 Jun 2012 11:40:16 +0100 Message-ID: <20431.13200.114406.125096@mariner.uk.xensource.com> References: <20120531045040.GA16124@imp.flyn.org> <20425.863.785362.721748@mariner.uk.xensource.com> <20120602141903.GA2903@imp.flyn.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120602141903.GA2903@imp.flyn.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "W. Michael Petullo" Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org W. Michael Petullo writes ("Re: [Xen-devel] Using "xl create" without domain config file"): ... > - if (!S_ISREG(stab.st_mode)) { > - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "%s is not a plain file", filename); > + if (S_ISDIR(stab.st_mode)) { > + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "%s is a directory", filename); This is not correct. If, for example, /dev/tty is specified, it will go wrong. The reason for the restriction to plain files is that those are the only thing on which stat works to provide the size. If we are to support other objects, we need to change the reading algorithm. Ian.