]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix race leading to crash when setting up dbus watches
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 18 Dec 2013 12:19:46 +0000 (12:19 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 18 Dec 2013 16:59:02 +0000 (16:59 +0000)
commit7d3a1c8bd1a2d376dfb5d7ee6a1bca8772ec2949
treeb2736899bd915cac2e30b66ff5c534cb7c80b7c0
parent284d2fc29946b7f5edeb520c0d5c97a3be4c57aa
Fix race leading to crash when setting up dbus watches

Currently the virDBusAddWatch does

  virEventAddHandle(fd, flags,
                    virDBusWatchCallback,
                    watch, NULL);
  dbus_watch_set_data(watch, info, virDBusWatchFree);

Unfortunately this is racy - since the event loop is in a
different thread, the virDBusWatchCallback method may be
run before we get to calling dbus_watch_set_data. We must
reverse the order of these calls

See https://bugzilla.redhat.com/show_bug.cgi?id=885445

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virdbus.c