vnc: fix unfinalized tlscreds for VncDisplay
commit521534df57cc0bee7b0da9e69fbbaa7149036ddb
authorZihao Chang <changzihao1@huawei.com>
Mon, 11 Jan 2021 13:19:11 +0000 (11 21:19 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 15 Jan 2021 10:22:42 +0000 (15 11:22 +0100)
tree239e099844b291d1bbf84d927701645e92ea972e
parentcab82424f6f246e1ef51bb6b10fbb5114e166aaf
vnc: fix unfinalized tlscreds for VncDisplay

In vnc_display_open(), if tls-creds is enabled, do object_ref(object
ref 1->2) for tls-creds. While in vnc_display_close(), object_unparent
sets object ref to 1(2->1) and  unparent the object for root.
Problem:
1. the object can not be found from the objects_root, while the object
is not finalized.
2. the qemu_opts of tls-creds(id: creds0) is not deleted, so new tls
object with the same id(creds0) can not be delete & add.

Signed-off-by: Zihao Chang <changzihao1@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210111131911.805-1-changzihao1@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/vnc.c