aboutsummaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-19 15:17:08 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-19 15:17:08 +0000
commitc35734b2a6f9b028edacd5813ff271728ce2a9e3 (patch)
tree912fb17654bdcc79592e1462cd86139ce5e7a78a /vnc.c
parentdcfb90144bd83a13e24f214e0c4a1b0b55067289 (diff)
Add -name option, by Anthony Liguori.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2505 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vnc.c b/vnc.c
index f729e05d8f..aba60d4c24 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1056,6 +1056,8 @@ static int protocol_client_msg(VncState *vs, char *data, size_t len)
static int protocol_client_init(VncState *vs, char *data, size_t len)
{
char pad[3] = { 0, 0, 0 };
+ char buf[1024];
+ int size;
vs->width = vs->ds->width;
vs->height = vs->ds->height;
@@ -1100,8 +1102,13 @@ static int protocol_client_init(VncState *vs, char *data, size_t len)
vnc_write(vs, pad, 3); /* padding */
- vnc_write_u32(vs, 4);
- vnc_write(vs, "QEMU", 4);
+ if (qemu_name)
+ size = snprintf(buf, sizeof(buf), "QEMU (%s)", qemu_name);
+ else
+ size = snprintf(buf, sizeof(buf), "QEMU");
+
+ vnc_write_u32(vs, size);
+ vnc_write(vs, buf, size);
vnc_flush(vs);
vnc_read_when(vs, protocol_client_msg, 1);