xl: 'xl vncviewer' accesses port 0 by any invalid domid
authorChunyan Liu <cyliu@suse.com>
Fri, 18 Jul 2014 06:18:04 +0000 (14:18 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 18 Jul 2014 12:37:47 +0000 (13:37 +0100)
commit2a8cc1a55329ead252ed323ec4bbee534d5c0f23
treefeaf68b8a342e22c893193c794a3b7054d1fc118
parent1ae93d3db81447c101b7fd7af0dc61a53246cbd3
xl: 'xl vncviewer' accesses port 0 by any invalid domid

Currently, with command:
  xl vncviewer invalid_domid
it always brings user to the domU using vncport 5900.
The invalid domid could be an non-existing one or Dom0.
It's better to report error in this case.

Correct libxl_vncviewer_exec:
  In existing code, when vncport is NULL, it still continues
  and will show vncport 5900. So, with 'xl vncviewer 0' it also
  wrongly shows domU using vncport 5900. Correct it to report error
  if vncport is NULL.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c