diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c index 004a2dab8132ba89645f2abefc04257bd8c9e016..db95a601c7d4e455dab0122257157698c92c09d6 100644 --- a/src/util/virportallocator.c +++ b/src/util/virportallocator.c @@ -35,6 +35,8 @@ #define VIR_FROM_THIS VIR_FROM_NONE +#define VIR_PORT_ALLOCATOR_NUM_PORTS 65536 + typedef struct _virPortAllocator virPortAllocator; typedef virPortAllocator *virPortAllocatorPtr; struct _virPortAllocator { @@ -68,7 +70,7 @@ virPortAllocatorNew(void) if (!(pa = virObjectLockableNew(virPortAllocatorClass))) return NULL; - if (!(pa->bitmap = virBitmapNew(USHRT_MAX))) + if (!(pa->bitmap = virBitmapNew(VIR_PORT_ALLOCATOR_NUM_PORTS))) goto error; return pa;