vnc: auto assian an id when calling change vnc qmp interface
authorGonglei <arei.gonglei@huawei.com>
Thu, 5 Feb 2015 09:43:35 +0000 (17:43 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 16 Feb 2015 07:47:59 +0000 (08:47 +0100)
Only in this way, change vnc qmp interface can take effect,
because qemu_opts_find(&qemu_vnc_opts, id) will return NULL
in vnc_display_open(), It can't connect successfully vnc
server forever.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qmp.c

diff --git a/qmp.c b/qmp.c
index 6b2c4bef3b2f5d8883cf9f1adb46986da876e574..d701cff5ac1f764cddd3461fc09e3e57381491bf 100644 (file)
--- a/qmp.c
+++ b/qmp.c
@@ -387,6 +387,11 @@ static void qmp_change_vnc_listen(const char *target, Error **errp)
         qemu_opts_del(opts);
     }
     opts = vnc_parse_func(target);
+    if (!opts) {
+        return;
+    }
+
+    vnc_auto_assign_id(olist, opts);
     vnc_display_open("default", errp);
 }