Ian Campbell writes ("Re: [Xen-devel] Re: [Fedora-xen] Xl and /dev/null (no 
domU cfgfile)"):
> On Mon, 2011-08-01 at 23:03 +0100, Pasi Kärkkäinen wrote:
> > On Mon, Aug 01, 2011 at 01:30:43PM -0500, W. Michael Petullo wrote:
> > > $ sudo xl create /dev/null
> > > libxl: error: libxl_utils.c:328:libxl_read_file_contents /dev/null is not 
> > > a plain file: Success
> > > Failed to read config file: /dev/null: Inappropriate ioctl for device
> 
> That's a pretty weird interface, probably more of a coincidence than a
> deliberate feature. Far better would be to just make the file optional.
> Can someone cook up such a patch?

The error message is a bit poor too.

> If we are looking to be bug/oddity compatible with xm then we could
> remove the S_ISREG check from libxl_read_file_contents. I suppose that,
> in principal at least, there is no reason to prevent people reading
> pipes, fifos, symlinks or even character devices to get the
> configuration file. (unless we might potentially read it multiple
> times?).

The reason for the S_ISREG check is that xl needs to take the config
file and store it as the userdata.  That means it needs to read the
whole thing into memory, which is easier if you can stat the file to
find out its length.

It would not be impossible or unreasonable to relax this restriction.
I would be happy to take a patch that used a realloc approach in the
!S_ISREG case.

Ian.
--
xen mailing list
xen@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/xen

Reply via email to