[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v6 05/18] xl: remove parsing of "vncviewer" option in xl domain config file

Print out a warning and suggest user use "-V" option when invoking "xl
create". Also remove that option in manpage. This will introduce a
minor functional regression but it's very easy to work around.

The rationale behind this change is that, this option is actually not
part of domain configuration. It just affects whether a vncviewer
should be automatically spawn, but has nothing to do with how a domain
should be constructed. And this option is also bogus, considering if you
migrate a domain to a remote host and the receiver spawns a vncviewer on
the receiving side then it either dies silently or occupies resource.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
 docs/man/xl.cfg.pod.5    |    4 ----
 tools/libxl/xl_cmdimpl.c |   21 ++++++++-------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a94d037..c087cbc 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1114,10 +1114,6 @@ The default is cirrus.
 Allow access to the display via the VNC protocol.  This enables the
 other VNC-related settings.  The default is to enable this.
-=item B<vncviewer=BOOLEAN>
-Automatically spawn a vncviewer when creating/restoring a guest.
 =item B<vnclisten="ADDRESS[:DISPLAYNUM]">
 Specifies the IP address, and optionally VNC display number, to use.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 6901bac..3a33cff 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -693,9 +693,7 @@ static void parse_top_level_sdl_options(XLU_Config *config,
 static void parse_config_data(const char *config_source,
                               const char *config_data,
                               int config_len,
-                              libxl_domain_config *d_config,
-                              struct domain_create *dom_info)
+                              libxl_domain_config *d_config)
     const char *buf;
     long l;
@@ -929,12 +927,9 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long(config, "rtc_timeoffset", &l, 0))
         b_info->rtc_timeoffset = l;
-    if (dom_info && !xlu_cfg_get_long(config, "vncviewer", &l, 0)) {
-        /* Command line arguments must take precedence over what's
-         * specified in the configuration file. */
-        if (!dom_info->vnc)
-            dom_info->vnc = l;
-    }
+    if (!xlu_cfg_get_long(config, "vncviewer", &l, 0))
+        fprintf(stderr, "WARNING: ignoring \"vncviewer\" option. "
+                "Use \"-V\" option of \"xl create\" to automatically spawn 
     xlu_cfg_get_defbool(config, "localtime", &b_info->localtime, 0);
@@ -2117,7 +2112,7 @@ static uint32_t create_domain(struct domain_create 
     if (!dom_info->quiet)
         printf("Parsing config from %s\n", config_source);
-    parse_config_data(config_source, config_data, config_len, &d_config, 
+    parse_config_data(config_source, config_data, config_len, &d_config);
     if (migrate_fd >= 0) {
         if (d_config.c_info.name) {
@@ -2292,7 +2287,7 @@ start:
                 parse_config_data(config_source, config_data, config_len,
-                                  &d_config, dom_info);
+                                  &d_config);
                  * XXX FIXME: If this sleep is not there then domain
@@ -3103,7 +3098,7 @@ static void list_domains_details(const libxl_dominfo 
*info, int nb_domain)
         CHK_SYSCALL(asprintf(&config_source, "<domid %d data>", 
-        parse_config_data(config_source, (char *)data, len, &d_config, NULL);
+        parse_config_data(config_source, (char *)data, len, &d_config);
         if (default_output_format == OUTPUT_FORMAT_JSON)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
@@ -4404,7 +4399,7 @@ int main_config_update(int argc, char **argv)
-    parse_config_data(filename, config_data, config_len, &d_config, NULL);
+    parse_config_data(filename, config_data, config_len, &d_config);
     if (debug || dryrun_only)
         printf_info(default_output_format, -1, &d_config);

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.