[libvirt] [PATCH] daemon: only unref virNetServers once

Peter Krempa pkrempa at redhat.com
Thu Jun 18 08:06:03 UTC 2015


On Wed, Jun 17, 2015 at 18:29:16 +0200, Ján Tomko wrote:
> After we add srv and srvAdm to the virNetDaemon,
> it's its responsibility to unref them in virNetDaemonDispose.
> 
> Added by commits fa14207 and d5f4241.
> ---
>  daemon/libvirtd.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
> index 368e10c..9e6c489 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -1589,8 +1589,6 @@ int main(int argc, char **argv) {
>      virObjectUnref(adminProgram);
>      virNetDaemonClose(dmn);
>      virObjectUnref(dmn);
> -    virObjectUnref(srv);
> -    virObjectUnref(srvAdm);

virNetDaemonAddServer that adds them to the virNetDaemon increases the
reference count, thus the main function should retain it's reference.

I think these should remain and the bug needs to be fixed elsewhere.
I'm giving it a brief glance before I'll go complain to Martin for
breaking it.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150618/bcbedbac/attachment-0001.sig>


More information about the libvir-list mailing list