cleanup:
VIR_FREE(diskAlias);
- if ((ret < 0) && port)
+ if (ret < 0)
virPortAllocatorRelease(driver->remotePorts, port);
return ret;
}
virObjectUnlock(vm);
else
qemuDomainRemoveInactive(driver, vm);
- if (ret < 0 && priv->nbdPort) {
+ if (ret < 0) {
virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
priv->nbdPort = 0;
}
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 &&
graphics->data.vnc.autoport) {
- ignore_value(virPortAllocatorRelease(driver->remotePorts,
- graphics->data.vnc.port));
+ virPortAllocatorRelease(driver->remotePorts,
+ graphics->data.vnc.port);
}
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);
}
}