diff options
author | Johannes Berg <johannes.berg@intel.com> | 2020-01-23 09:17:04 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-02-27 03:46:10 -0500 |
commit | a7290a79fa262124916dab2bb75188cfd07faad6 (patch) | |
tree | 4dcbb22cba418a0bdf241b90c1aa9ab7a8abf93d /tests/test-crypto-block.c | |
parent | 8899d60142e790debe1604a89d0028ba1740d8e9 (diff) | |
download | qemu-a7290a79fa262124916dab2bb75188cfd07faad6.zip qemu-a7290a79fa262124916dab2bb75188cfd07faad6.tar.gz qemu-a7290a79fa262124916dab2bb75188cfd07faad6.tar.bz2 |
libvhost-user-glib: fix VugDev main fd cleanup
If you try to make a device implementation that can handle multiple
connections and allow disconnections (which requires overriding the
VHOST_USER_NONE handling), then glib will warn that we remove a src
while it's still on the mainloop, and will poll() an FD that doesn't
exist anymore.
Fix this by making vug_source_new() require pairing with the new
vug_source_destroy() so we can keep the GSource referenced in the
meantime.
Note that this requires calling the new API in vhost-user-input.
vhost-user-gpu also uses vug_source_new(), but never seems to free
the result at all, so I haven't changed anything there.
Fixes: 8bb7ddb78a1c ("libvhost-user: add glib source helper")
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Message-Id: <20200123081708.7817-3-johannes@sipsolutions.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/test-crypto-block.c')
0 files changed, 0 insertions, 0 deletions