aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-09-16 12:33:03 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-01-22 11:18:46 +0100
commit4db14629c38611061fc19ec6927405923de84f08 (patch)
tree91f5a9dbe009f55a16654f426d8484ccdc42c671 /qmp.c
parentc8496408b443a2a34dd03ad4274c2575248aa3e8 (diff)
vnc: switch to QemuOpts, allow multiple servers
This patch switches vnc over to QemuOpts, and it (more or less as side effect) allows multiple vnc server instances. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/qmp.c b/qmp.c
index 0b4f131936..963305c269 100644
--- a/qmp.c
+++ b/qmp.c
@@ -368,7 +368,20 @@ void qmp_change_vnc_password(const char *password, Error **errp)
static void qmp_change_vnc_listen(const char *target, Error **errp)
{
- vnc_display_open(NULL, target, errp);
+ QemuOptsList *olist = qemu_find_opts("vnc");
+ QemuOpts *opts;
+
+ if (strstr(target, "id=")) {
+ error_setg(errp, "id not supported");
+ return;
+ }
+
+ opts = qemu_opts_find(olist, "default");
+ if (opts) {
+ qemu_opts_del(opts);
+ }
+ opts = vnc_parse_func(target);
+ vnc_display_open("default", errp);
}
static void qmp_change_vnc(const char *target, bool has_arg, const char *arg,