[PATCH 1/3] util: virtportallocator: Add VIR_DEBUG statements for port allocations and release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a few debug statements to be able to trace lifetime of a
reserved/allocated port.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virportallocator.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c
index 6d6f99778e..70393d87ee 100644
--- a/src/util/virportallocator.c
+++ b/src/util/virportallocator.c
@@ -29,9 +29,12 @@
 #include "virthread.h"
 #include "virerror.h"
 #include "virutil.h"
+#include "virlog.h"

 #define VIR_FROM_THIS VIR_FROM_NONE

+VIR_LOG_INIT("util.virportallocator");
+
 #define VIR_PORT_ALLOCATOR_NUM_PORTS 65536

 typedef struct _virPortAllocator virPortAllocator;
@@ -228,6 +231,8 @@ virPortAllocatorAcquire(const virPortAllocatorRange *range,
                     return -1;
                 }
                 *port = i;
+                VIR_DEBUG("port='%u'", *port);
+
                 return 0;
             }
         }
@@ -247,6 +252,8 @@ virPortAllocatorRelease(unsigned short port)
     if (!pa)
         return -1;

+    VIR_DEBUG("port='%u'", port);
+
     if (!port)
         return 0;

@@ -265,6 +272,8 @@ virPortAllocatorSetUsed(unsigned short port)
     if (!pa)
         return -1;

+    VIR_DEBUG("port='%u'", port);
+
     if (!port)
         return 0;

-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux