Pasi Kärkkäinen
2011-Aug-01 22:03 UTC
[Xen-devel] Re: [Fedora-xen] Xl and /dev/null (no domU cfgfile)
On Mon, Aug 01, 2011 at 01:30:43PM -0500, W. Michael Petullo wrote:> The old xm command allowed for a domain to be configured from and > command line using "xm create /dev/null kernel=x ..." Xl does not seem > to support this: > > $ 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 > > Does anyone know the preferred technique to create a domain without an > existing domain configuration file (i.e., purely from the command line)? >Sounds like a question to xen-devel mailinglist.. at least I haven''t seen a solution to that so far. (CC added). -- Pasi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2011-Aug-09 09:32 UTC
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: > > The old xm command allowed for a domain to be configured from and > > command line using "xm create /dev/null kernel=x ..." Xl does not seem > > to support this: > > > > $ 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? 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?).> > > Does anyone know the preferred technique to create a domain without an > > existing domain configuration file (i.e., purely from the command line)? > > > > Sounds like a question to xen-devel mailinglist.. at least I haven''t > seen a solution to that so far.> > (CC added). > > -- Pasi > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Aug-09 16:44 UTC
Re: [Xen-devel] Re: [Fedora-xen] Xl and /dev/null (no domU cfgfile)
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-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel