1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

conf: Remove dead code

The switch in virDomainPCIControllerModelToConnectType()
had some code that, while techically part of the
_PCIE_SWITCH_DOWNSTREAM_PORT case, was in fact dead due
to the early return.

Get rid of the dead code, and fix the inaccurate function
description while at it.
This commit is contained in:
Andrea Bolognani 2017-02-20 15:56:18 +01:00
parent 75ba06e44a
commit c6a0fb8e71

View File

@ -35,9 +35,8 @@ VIR_LOG_INIT("conf.domain_addr");
virDomainPCIConnectFlags
virDomainPCIControllerModelToConnectType(virDomainControllerModelPCI model)
{
/* given a VIR_DOMAIN_CONTROLLER_MODEL_PCI*, set connectType to
* the equivalent VIR_PCI_CONNECT_TYPE_*. return 0 on success, -1
* if the model wasn't recognized.
/* given a VIR_DOMAIN_CONTROLLER_MODEL_PCI*, return
* the equivalent VIR_PCI_CONNECT_TYPE_*.
*/
switch (model) {
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST:
@ -70,14 +69,6 @@ virDomainPCIControllerModelToConnectType(virDomainControllerModelPCI model)
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
return VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT;
/* if this happens, there is an error in the code. A
* PCI controller should always have a proper model
* set
*/
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("PCI controller model incorrectly set to 'last'"));
return -1;
}
return 0;
}