From: "W. Michael Petullo" <mike@flyn.org>
To: xen-devel@lists.xen.org
Subject: Using "xl create" without domain config file
Date: Wed, 30 May 2012 23:50:41 -0500 [thread overview]
Message-ID: <20120531045040.GA16124@imp.flyn.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 862 bytes --]
I found it useful to use xm without a domain configuration file:
xm create /dev/null kernel=...
The xl command does not support this. See a previous thread I started:
http://lists.xen.org/archives/html/xen-devel/2011-08/msg00330.html
I just found the time to modify xl so that it works without a domain
configuration file. For example:
xl create kernel=\"...\" ...
Would it be possible to add this feature? The xl command already supports
augmenting a domain configuration file with additional information
from the command line. My changes just modify xl so that the entire
configuration may be specified on the command line.
To test this patch, run:
1. xl create -c /path/to/config
2. xl create -c /path/to/config someAdditionalDomainParam=\"value\"
3. xl create -c kernel=\"/path/to/kernel\"
The third test covers the new case.
--
Mike
:wq
[-- Attachment #2: xen-4.1.2-xl-command-line-domain-def.patch --]
[-- Type: text/plain, Size: 2381 bytes --]
diff -u --recursive --new-file xen-4.1.2-vanilla/tools/libxl/xl_cmdimpl.c xen-4.1.2/tools/libxl/xl_cmdimpl.c
--- xen-4.1.2-vanilla/tools/libxl/xl_cmdimpl.c 2011-10-20 12:05:43.000000000 -0500
+++ xen-4.1.2/tools/libxl/xl_cmdimpl.c 2012-05-30 23:37:51.261948881 -0500
@@ -1442,30 +1442,32 @@
&config_data, &config_len);
if (ret) { fprintf(stderr, "Failed to read config file: %s: %s\n",
config_file, strerror(errno)); return ERROR_FAIL; }
- if (!restore_file && extra_config && strlen(extra_config)) {
- if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) {
- fprintf(stderr, "Failed to attach extra configration\n");
- return ERROR_FAIL;
- }
- /* allocate space for the extra config plus two EOLs plus \0 */
- config_data = realloc(config_data, config_len
- + strlen(extra_config) + 2 + 1);
- if (!config_data) {
- fprintf(stderr, "Failed to realloc config_data\n");
- return ERROR_FAIL;
- }
- config_len += sprintf(config_data + config_len, "\n%s\n",
- extra_config);
- }
} else {
- if (!config_data) {
- fprintf(stderr, "Config file not specified and"
+ if (!config_data && !extra_config) {
+ fprintf(stderr, "Domain config file not specified,"
+ " none on command line, and"
" none in save file\n");
return ERROR_INVAL;
}
config_file = "<saved>";
}
+ if (!restore_file && extra_config && strlen(extra_config)) {
+ if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) {
+ fprintf(stderr, "Failed to attach extra configration\n");
+ return ERROR_FAIL;
+ }
+ /* allocate space for the extra config plus two EOLs plus \0 */
+ config_data = realloc(config_data, config_len
+ + strlen(extra_config) + 2 + 1);
+ if (!config_data) {
+ fprintf(stderr, "Failed to realloc config_data\n");
+ return ERROR_FAIL;
+ }
+ config_len += sprintf(config_data + config_len, "\n%s\n",
+ extra_config);
+ }
+
if (!dom_info->quiet)
printf("Parsing config file %s\n", config_file);
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2012-05-31 4:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 4:50 W. Michael Petullo [this message]
2012-06-01 5:45 ` Using "xl create" without domain config file Ian Campbell
2012-06-01 18:01 ` Ian Jackson
2012-06-02 14:19 ` W. Michael Petullo
2012-06-06 10:40 ` Ian Jackson
2012-06-07 17:41 ` Ian Jackson
2012-06-08 18:31 ` W. Michael Petullo
2012-06-11 13:41 ` Ian Jackson
2012-06-11 20:22 ` W. Michael Petullo
2012-07-04 14:48 ` Ian Campbell
2012-08-17 21:37 ` W. Michael Petullo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120531045040.GA16124@imp.flyn.org \
--to=mike@flyn.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).