return 0;
error:
- if (port)
- virPortAllocatorRelease(driver->remotePorts, port);
+ virPortAllocatorRelease(driver->remotePorts, port);
return -1;
}
}
}
- if (priv->nbdPort) {
- virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
- priv->nbdPort = 0;
- }
+ virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
+ priv->nbdPort = 0;
if (priv->agent) {
qemuAgentClose(priv->agent);
virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
if (graphics->data.vnc.autoport) {
- ignore_value(virPortAllocatorRelease(driver->remotePorts,
- graphics->data.vnc.port));
- }
- if (graphics->data.vnc.websocket) {
- ignore_value(virPortAllocatorRelease(driver->webSocketPorts,
- graphics->data.vnc.websocket));
+ virPortAllocatorRelease(driver->remotePorts,
+ graphics->data.vnc.port);
}
+ virPortAllocatorRelease(driver->webSocketPorts,
+ graphics->data.vnc.websocket);
}
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
graphics->data.spice.autoport) {
- ignore_value(virPortAllocatorRelease(driver->remotePorts,
- graphics->data.spice.port));
- ignore_value(virPortAllocatorRelease(driver->remotePorts,
- graphics->data.spice.tlsPort));
+ virPortAllocatorRelease(driver->remotePorts,
+ graphics->data.spice.port);
+ virPortAllocatorRelease(driver->remotePorts,
+ graphics->data.spice.tlsPort);
}
}