[libvirt] [PATCH v2 3/9] locking: Remove redundant 'srv' element from virLockDaemon

Martin Kletzander mkletzan at redhat.com
Fri Aug 21 21:45:12 UTC 2015


On Fri, Aug 21, 2015 at 08:04:04PM +0200, Erik Skultety wrote:
>Now that we have virNetDaemon object holding all the data and being
>capable of referencing multiple servers, having a duplicate reference to
>a single server stored in virLockDaemon isn't necessary anymore. This
>patch removes the above described element.
>---
> src/locking/lock_daemon.c | 40 +++++++++++++++++++++-------------------
> 1 file changed, 21 insertions(+), 19 deletions(-)
>
>diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
>index c035024..ae3a507 100644
>--- a/src/locking/lock_daemon.c
>+++ b/src/locking/lock_daemon.c
>@@ -1353,14 +1354,15 @@ int main(int argc, char **argv) {
>             goto cleanup;
>         }
>
>-        if ((rv = virLockDaemonSetupNetworkingSystemD(lockDaemon->srv)) < 0) {
>+        srv = virNetDaemonGetServer(lockDaemon->dmn, 0);

This increases the refcount, you need to match it with virObjectUnref(srv);

ACK with this squashed in:

diff --git i/src/locking/lock_daemon.c w/src/locking/lock_daemon.c
index 94f9b11a4829..a50828f56e48 100644
--- i/src/locking/lock_daemon.c
+++ w/src/locking/lock_daemon.c
@@ -1424,6 +1424,7 @@ int main(int argc, char **argv) {
         ret = 0;

  cleanup:
+    virObjectUnref(srv);
     virObjectUnref(lockProgram);
     virLockDaemonFree(lockDaemon);
     if (statuswrite != -1) {
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150821/1aaf42a8/attachment-0001.sig>


More information about the libvir-list mailing list