diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-09-16 12:33:03 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-01-22 11:18:46 +0100 |
commit | 4db14629c38611061fc19ec6927405923de84f08 (patch) | |
tree | 91f5a9dbe009f55a16654f426d8484ccdc42c671 /qmp.c | |
parent | c8496408b443a2a34dd03ad4274c2575248aa3e8 (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.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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, |