vnc: remove vnc_display global

Replace with a vnc_displays list, so we can have multiple vnc server
instances.  Add vnc_server_find function to lookup a display by id.
With no id supplied return the first vnc server, for backward
compatibility reasons.

It is not possible (yet) to actually create multiple vnc server
instances.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
This commit is contained in:
Gerd Hoffmann 2014-07-29 12:14:08 +02:00
parent 699eae17b8
commit d616ccc5dd
2 changed files with 43 additions and 22 deletions

View file

@ -171,6 +171,8 @@ struct VncDisplay
struct VncSurface guest; /* guest visible surface (aka ds->surface) */
pixman_image_t *server; /* vnc server surface */
const char *id;
QTAILQ_ENTRY(VncDisplay) next;
char *display;
char *password;
time_t expires;