From: Ian Jackson Subject: Re: Using "xl create" without domain config file Date: Thu, 7 Jun 2012 18:41:53 +0100 Message-ID: <20432.59361.773966.629519@mariner.uk.xensource.com> References: <20120531045040.GA16124@imp.flyn.org> <20425.863.785362.721748@mariner.uk.xensource.com> <20120602141903.GA2903@imp.flyn.org> <20431.13200.114406.125096@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20431.13200.114406.125096@mariner.uk.xensource.com> 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" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson writes ("Re: [Xen-devel] Using "xl create" without domain config file"): > 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. Another alternative would be to special-case the string "/dev/null" (in xl, not libxl) and not read a config file at all in that case. Ian.