aboutsummaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-05 20:20:30 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-05 20:20:30 +0000
commita9ce859052ccb0d588173dfa11bc9cd6858ec6c3 (patch)
tree2b91e312bc90a2ed4e06d79e6ee303a9103f864f /vnc.c
parent564c337efd415df3ab58c5bd080139e9f997d265 (diff)
info vnc command (Anthony Liguori)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2391 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/vnc.c b/vnc.c
index 30dc516527..f729e05d8f 100644
--- a/vnc.c
+++ b/vnc.c
@@ -73,6 +73,8 @@ struct VncState
int last_x;
int last_y;
+ const char *display;
+
Buffer output;
Buffer input;
kbd_layout_t *kbd_layout;
@@ -90,6 +92,24 @@ struct VncState
uint8_t modifiers_state[256];
};
+static VncState *vnc_state; /* needed for info vnc */
+
+void do_info_vnc(void)
+{
+ if (vnc_state == NULL)
+ term_printf("VNC server disabled\n");
+ else {
+ term_printf("VNC server active on: ");
+ term_print_filename(vnc_state->display);
+ term_printf("\n");
+
+ if (vnc_state->csock == -1)
+ term_printf("No client connected\n");
+ else
+ term_printf("Client connected\n");
+ }
+}
+
/* TODO
1) Get the queue working for IO.
2) there is some weirdness when using the -S option (the screen is grey
@@ -1150,6 +1170,8 @@ void vnc_display_init(DisplayState *ds, const char *arg)
exit(1);
ds->opaque = vs;
+ vnc_state = vs;
+ vs->display = arg;
vs->lsock = -1;
vs->csock = -1;