xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Using "xl create" without domain config file
@ 2012-05-31  4:50 W. Michael Petullo
  2012-06-01  5:45 ` Ian Campbell
  2012-06-01 18:01 ` Ian Jackson
  0 siblings, 2 replies; 11+ messages in thread
From: W. Michael Petullo @ 2012-05-31  4:50 UTC (permalink / raw)
  To: xen-devel

[-- 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-08-17 21:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31  4:50 Using "xl create" without domain config file W. Michael Petullo
2012-06-01  5:45 ` 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

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).