diff options
Diffstat (limited to 'xd_view.c')
-rw-r--r-- | xd_view.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -132,15 +132,15 @@ static void open_tty(gint id, char *name, char *tty) } } -static void open_vnc(gint id, char *hostname, gint displayno) +static void open_vnc(gint id, char *hostname, gint tcpport) { #ifdef HAVE_VNCCLIENT if (1) { - vnc_open(hostname, displayno, VNC_FLAG_US_KBD, 0); + vnc_open(hostname, tcpport, VNC_FLAG_US_KBD, 0); return; } #endif - if (-1 == open_vnc_session(hostname, id)) + if (-1 == open_vnc_session(hostname, tcpport)) gtk_message(GTK_MESSAGE_ERROR, app_error); } @@ -304,7 +304,7 @@ static void menu_cb_mdns(void) static void menu_cb_open_vnc(void) { char *name, *tty, *ostype; - gint id = -1, vncport, displayno = -1; + gint id = -1, vncport, tcpport = -1; if (!get_domain(&id, &name, &ostype, &tty, &vncport)) return; @@ -313,14 +313,14 @@ static void menu_cb_open_vnc(void) if (vncport) /* xen 3.0.3+ */ - displayno = vncport - 5900; + tcpport = vncport; else if (0 == strcmp(ostype, "hvm")) { /* xen 3.0.2 */ - displayno = id; + tcpport = id + 5900; } - if (-1 != displayno) - open_vnc(id, "localhost", displayno); + if (-1 != tcpport) + open_vnc(id, "localhost", tcpport); else gtk_message(GTK_MESSAGE_ERROR, "Domain has no graphical display.\n"); } |