From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH v6 05/18] xl: remove parsing of "vncviewer" option in xl domain config file Date: Mon, 9 Jun 2014 13:43:16 +0100 Message-ID: <1402317809-26833-6-git-send-email-wei.liu2@citrix.com> References: <1402317809-26833-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402317809-26833-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Wei Liu , ian.jackson@eu.citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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 Acked-by: Ian Campbell --- 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 - -Automatically spawn a vncviewer when creating/restoring a guest. - =item B 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 vncviewer.\n"); xlu_cfg_get_defbool(config, "localtime", &b_info->localtime, 0); @@ -2117,7 +2112,7 @@ static uint32_t create_domain(struct domain_create *dom_info) if (!dom_info->quiet) printf("Parsing config from %s\n", config_source); - parse_config_data(config_source, config_data, config_len, &d_config, dom_info); + 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: libxl_domain_config_dispose(&d_config); libxl_domain_config_init(&d_config); 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) continue; CHK_SYSCALL(asprintf(&config_source, "", info[i].domid)); libxl_domain_config_init(&d_config); - 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); else @@ -4404,7 +4399,7 @@ int main_config_update(int argc, char **argv) libxl_domain_config_init(&d_config); - 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); -- 1.7.10.4