mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
util: virtportallocator: Add VIR_DEBUG statements for port allocations and release
Add a few debug statements to be able to trace lifetime of a reserved/allocated port. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
c697aff8a1
commit
19eaa85438
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user