[libvirt] [RFC PATCH v1 1/7] call virstateCleanup to do the cleanup before libvirtd exits

Daniel P. Berrange berrange at redhat.com
Thu Jan 17 17:28:28 UTC 2013


On Wed, Jan 16, 2013 at 10:53:03AM +0800, Hu Tao wrote:
> ---
>  daemon/libvirtd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
> index 9cdf4d9..7cb99b1 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -1500,5 +1500,7 @@ cleanup:
>  
>      daemonConfigFree(config);
>  
> +    virStateCleanup();
> +
>      return ret;
>  }

Unfortunately this causes libvirtd to segv, if you Ctrl-C the daemon
shortly after startup. The problem is that virStateCleanup is running
before virStateInitialize has finished its work. We probably need to
put a mutex in the virStateInitialize+virStateCleanup functions to
make sure they serialize

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list