Vladimir Sementsov-Ogievskiy 2e572baf65 ui/vnc-clipboard: fix adding notifier twice
vnc_server_cut_text_caps() is not guaranteed to be called only once.

If it called twice, we finally call notifier_list_add() twice with same
element. Which leads to loopback QLIST. So, on next
notifier_list_notify() we'll loop forever and QEMU stuck.

So, let's only register new notifier if it's not yet registered.

Note, that similar check is used in vdagent_chr_recv_caps() (before
call qemu_clipboard_peer_register()), and also before
qemu_clipboard_peer_unregister() call in vdagent_disconnect() and in
vnc_disconnect_finish().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211110103800.2266729-1-vsementsov@virtuozzo.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-22 11:14:28 +01:00
..
2020-09-30 19:09:19 +02:00
2021-07-26 10:24:49 +02:00
2019-03-11 08:39:02 +01:00
2021-02-04 15:58:54 +01:00
2020-10-15 16:35:06 +01:00
2019-08-16 13:31:52 +02:00
2020-12-10 12:15:18 -05:00
2020-08-21 06:30:21 -04:00
2021-08-31 17:25:14 +04:00
2019-02-05 16:50:18 +01:00
2021-01-23 15:55:07 -05:00
2021-05-21 09:42:44 +02:00