port allocator: remove release functionality from set used

Let's use virPortAllocatorRelease instead of virPortAllocatorSetUsed(false).

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy authored and Michal Privoznik committed 2018-02-22 13:52:45 +01:00
1 parent 4c9c7a5ba2
commit 5dbda5e972
7 files changed
+21 -39

No files matched your search

+2 -6
View File
@@ -93,12 +93,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
out:
if (vmdef &&
vmdef->ngraphics == 1 &&
vmdef->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
if (vmdef->graphics[0]->data.vnc.autoport)
virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port);
else
virPortAllocatorSetUsed(vmdef->graphics[0]->data.vnc.port, false);
}
vmdef->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port);
VIR_FREE(actualargv);
VIR_FREE(actualld);
+2 -6
View File
@@ -113,12 +113,8 @@ testCompareXMLToDomConfig(const char *xmlfile,
cleanup:
if (vmdef &&
vmdef->ngraphics == 1 &&
vmdef->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
if (vmdef->graphics[0]->data.vnc.autoport)
virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port);
else
virPortAllocatorSetUsed(vmdef->graphics[0]->data.vnc.port, false);
}
vmdef->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port);
VIR_FREE(expectjson);
VIR_FREE(actualjson);