xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [PATCH 2 of 4 v2] xl: Check for duplicate vncdisplay options, and return an error
Date: Fri, 30 Nov 2012 16:24:17 +0000	[thread overview]
Message-ID: <fa37bd276212a01e3c89.1354292657@elijah> (raw)
In-Reply-To: <patchbomb.1354292655@elijah>

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354291984 0
# Node ID fa37bd276212a01e3c898b54a7f2385454c406a7
# Parent  722da032ac90c0e1a78b1154fa588bf295d1f009
xl: Check for duplicate vncdisplay options, and return an error

If the user has set a vnc display number both in vnclisten (with
"xxxx:yy"), and with vncdisplay, throw an error.

Update man pages to match.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -350,11 +350,17 @@ other VNC-related settings.  The default
 
 Specifies the IP address, and optionally VNC display number, to use.
 
+NB that if you specify the display number here, you should not use
+vncdisplay.
+
 =item C<vncdisplay=DISPLAYNUM>
 
 Specifies the VNC display number to use.  The actual TCP port number
 will be DISPLAYNUM+5900.
 
+NB that you should not use this option if you set the displaynum in the 
+vnclisten string.
+
 =item C<vncunused=BOOLEAN>
 
 Requests that the VNC display setup search for a free TCP port to use.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1257,6 +1257,7 @@ skip_nic:
                     vfb->sdl.xauthority = strdup(p2 + 1);
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
+
 skip_vfb:
             free(buf2);
             d_config->num_vfbs++;
@@ -1490,6 +1491,16 @@ skip_vfb:
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
+
+        if(b_info->u.hvm.vnc.listen
+           && b_info->u.hvm.vnc.display
+           && strchr(b_info->u.hvm.vnc.listen, ':') != NULL) {
+            fprintf(stderr,
+                    "ERROR: Display specified both in vnclisten"
+                    " and vncdisplay!\n");
+            exit (1);
+            
+        }
     }
 
     xlu_cfg_destroy(config);

  parent reply	other threads:[~2012-11-30 16:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 16:24 [PATCH 0 of 4 v2] Allow xl to build a domain with multiple USB devices George Dunlap
2012-11-30 16:24 ` [PATCH 1 of 4 v2] libxl: Combine device model arg build functions George Dunlap
2012-11-30 16:53   ` George Dunlap
2012-12-04 15:21   ` Ian Campbell
2012-11-30 16:24 ` George Dunlap [this message]
2012-12-05 11:22   ` [PATCH 2 of 4 v2] xl: Check for duplicate vncdisplay options, and return an error Ian Campbell
2012-11-30 16:24 ` [PATCH 3 of 4 v2] libxl: Allow multiple USB devices on HVM domain creation George Dunlap
2012-12-04 15:30   ` Ian Campbell
2012-11-30 16:24 ` [PATCH 4 of 4 v2] xl: Accept a list for usbdevice in config file George Dunlap
2012-12-04 15:50   ` Ian Campbell

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=fa37bd276212a01e3c89.1354292657@elijah \
    --to=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).