[libvirt] [PATCH 3/3] Remove use of virConnectPtr from all remaining nwfilter code

Laine Stump laine at laine.org
Thu Oct 3 13:52:35 UTC 2013


On 10/03/2013 09:07 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> The virConnectPtr is passed around loads of nwfilter code in
> order to provide it as a parameter to the callback registered
> by the virt drivers. None of the virt drivers use this param
> though, so it serves no purpose.
>
> Avoiding the need to pass a virConnectPtr means that the
> nwfilterStateReload method no longer needs to open a bogus
> QEMU driver connection. This addresses a race condition that
> can lead to a crash on startup.
>
> The nwfilter driver starts before the QEMU driver and registers
> some callbacks with DBus to detect firewalld reload. If the
> firewalld reload happens while the QEMU driver is still starting
> up though, the nwfilterStateReload method will open a connection
> to the partially initialized QEMU driver and cause a crash.
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/conf/nwfilter_conf.c       | 49 ++++++++++++++++--------------------------
>  src/conf/nwfilter_conf.h       | 14 +++++-------
>  src/lxc/lxc_driver.c           |  3 +--
>  src/nwfilter/nwfilter_driver.c | 42 ++++++++++++++----------------------
>  src/qemu/qemu_driver.c         |  3 +--
>  src/uml/uml_driver.c           |  3 +--
>  6 files changed, 43 insertions(+), 71 deletions(-)
>

ACK.




More information about the libvir-list mailing list