nodedev: Remove @create from virNodeDeviceObjListGetParentHost

The only callers to this function are from CreateXML paths now, so
let's just remove the unnecessary parameter.
This commit is contained in:
John Ferlan 2017-07-20 09:17:22 -04:00
parent 5ba2ce658b
commit 8f6679d9f6
4 changed files with 5 additions and 8 deletions

View File

@ -545,8 +545,7 @@ virNodeDeviceObjListFindVportParentHost(virNodeDeviceObjListPtr devs)
int
virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
virNodeDeviceDefPtr def,
int create)
virNodeDeviceDefPtr def)
{
int parent_host = -1;
@ -561,7 +560,7 @@ virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
parent_host =
virNodeDeviceObjListGetParentHostByFabricWWN(devs, def->name,
def->parent_fabric_wwn);
} else if (create == CREATE_DEVICE) {
} else {
/* Try to find a vport capable scsi_host when no parent supplied */
parent_host = virNodeDeviceObjListFindVportParentHost(devs);
}

View File

@ -75,8 +75,7 @@ virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs,
int
virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
virNodeDeviceDefPtr def,
int create);
virNodeDeviceDefPtr def);
virNodeDeviceObjListPtr
virNodeDeviceObjListNew(void);

View File

@ -563,8 +563,7 @@ nodeDeviceCreateXML(virConnectPtr conn,
if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) == -1)
goto cleanup;
if ((parent_host = virNodeDeviceObjListGetParentHost(driver->devs, def,
CREATE_DEVICE)) < 0)
if ((parent_host = virNodeDeviceObjListGetParentHost(driver->devs, def)) < 0)
goto cleanup;
if (virVHBAManageVport(parent_host, wwpn, wwnn, VPORT_CREATE) < 0)

View File

@ -5477,7 +5477,7 @@ testNodeDeviceCreateXML(virConnectPtr conn,
/* Unlike the "real" code we don't need the parent_host in order to
* call virVHBAManageVport, but still let's make sure the code finds
* something valid and no one messed up the mock environment. */
if (virNodeDeviceObjListGetParentHost(driver->devs, def, CREATE_DEVICE) < 0)
if (virNodeDeviceObjListGetParentHost(driver->devs, def) < 0)
goto cleanup;
/* In the real code, we'd call virVHBAManageVport followed by