Xl and /dev/null (no domU cfgfile)
Quoted 11 lines · W. Michael Petullo
The old xm command allowed for a domain to be configured from and command line using "xm create
/dev/nullkernel=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 deviceDoes 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
Quoted 9 lines · Pasi Kärkkäinen
Quoted 8 lines · W. Michael Petullo
The old xm command allowed for a domain to be configured from and command line using "xm create
/dev/nullkernel=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?).
Quoted 19 lines
Quoted 4 lines
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
[email protected]
http://lists.xensource.com/xen-devel
Ian Campbell writes ("Re: [Xen-devel] Re: [Fedora-xen] Xl and /dev/null (no domU cfgfile)"):
Quoted 9 lines · Pasi Kärkkäinen
Quoted 4 lines · W. Michael Petullo
Quoted 3 lines
$ 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 deviceThat'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.
Quoted 6 lines
If we are looking to be bug/oddity compatible with xm then we could remove the
S_ISREGcheck fromlibxl_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.