From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] PATCH 2/8: Extend monitor 'change' command for VNC
Date: Tue, 31 Jul 2007 20:25:58 +0100 [thread overview]
Message-ID: <20070731192558.GK18730@redhat.com> (raw)
In-Reply-To: <20070731192316.GI18730@redhat.com>
This patch extends the QEMU monitor 'change' command so that it can
be used to change the configuration of the VNC server. On the command
line the user can use -vnc none, and then issue the 'change vnc :1'
command later from the monitor. This is utilized in the next patch
to let the monitor fetch a password for the server. The concept could
also be extended to serial & parallel devices allowing changing of
their configuration on the fly.
diff -r e85f07144b6c monitor.c
--- a/monitor.c Tue Jul 31 10:53:15 2007 -0400
+++ b/monitor.c Tue Jul 31 10:55:31 2007 -0400
@@ -386,7 +386,7 @@ static void do_eject(int force, const ch
eject_device(bs, force);
}
-static void do_change(const char *device, const char *filename)
+static void do_change_block(const char *device, const char *filename)
{
BlockDriverState *bs;
@@ -399,6 +399,21 @@ static void do_change(const char *device
return;
bdrv_open(bs, filename, 0);
qemu_key_check(bs, filename);
+}
+
+static void do_change_vnc(const char *target)
+{
+ if (vnc_display_open(NULL, target) < 0)
+ term_printf("could not start VNC server on %s\n", target);
+}
+
+static void do_change(const char *device, const char *target)
+{
+ if (strcmp(device, "vnc") == 0) {
+ do_change_vnc(target);
+ } else {
+ do_change_block(device, target);
+ }
}
static void do_screen_dump(const char *filename)
diff -r e85f07144b6c vnc.c
--- a/vnc.c Tue Jul 31 10:53:15 2007 -0400
+++ b/vnc.c Tue Jul 31 10:55:06 2007 -0400
@@ -1208,7 +1208,7 @@ void vnc_display_init(DisplayState *ds)
void vnc_display_close(DisplayState *ds)
{
- VncState *vs = (VncState *)ds->opaque;
+ VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
if (vs->display) {
qemu_free(vs->display);
@@ -1230,7 +1230,7 @@ int vnc_display_open(DisplayState *ds, c
int reuse_addr, ret;
socklen_t addrlen;
const char *p;
- VncState *vs = (VncState *)ds->opaque;
+ VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
vnc_display_close(ds);
if (strcmp(arg, "none") == 0)
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
next prev parent reply other threads:[~2007-07-31 19:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 19:23 [Qemu-devel] PATCH 0/8: Authentication support for the VNC server Daniel P. Berrange
2007-07-31 19:25 ` [Qemu-devel] PATCH 1/8: Refactor VNC server setup API Daniel P. Berrange
2007-07-31 19:25 ` Daniel P. Berrange [this message]
2007-08-01 1:43 ` [Qemu-devel] PATCH 2/8: Extend monitor 'change' command for VNC Anthony Liguori
2007-07-31 19:26 ` [Qemu-devel] PATCH 3/8: VNC password authentication Daniel P. Berrange
2007-08-01 1:46 ` Anthony Liguori
2007-08-01 16:26 ` Daniel P. Berrange
2007-08-02 14:35 ` Anthony Liguori
2007-07-31 19:27 ` [Qemu-devel] PATCH 4/8: VeNCrypt basic TLS support Daniel P. Berrange
2007-08-01 1:50 ` Anthony Liguori
2007-08-01 16:28 ` Daniel P. Berrange
2007-07-31 19:28 ` [Qemu-devel] PATCH 5/8: x509 certificate for server Daniel P. Berrange
2007-07-31 19:28 ` [Qemu-devel] PATCH 6/8: x509 client certificate verification Daniel P. Berrange
2007-07-31 19:29 ` [Qemu-devel] PATCH 7/8: command line args for x509 cert paths Daniel P. Berrange
2007-08-01 1:54 ` Anthony Liguori
2007-08-01 16:31 ` Daniel P. Berrange
2007-07-31 19:30 ` [Qemu-devel] PATCH 8/8: document all VNC authentication options Daniel P. Berrange
2007-08-01 1:55 ` [Qemu-devel] PATCH 0/8: Authentication support for the VNC server Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2007-08-13 19:25 Daniel P. Berrange
2007-08-13 19:42 ` [Qemu-devel] PATCH 2/8: Extend monitor 'change' command for VNC Daniel P. Berrange
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=20070731192558.GK18730@redhat.com \
--to=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.