]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nodedev: Remove @create from virNodeDeviceObjListGetParentHost
authorJohn Ferlan <jferlan@redhat.com>
Thu, 20 Jul 2017 13:17:22 +0000 (09:17 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 24 Jul 2017 16:19:34 +0000 (12:19 -0400)
The only callers to this function are from CreateXML paths now, so
let's just remove the unnecessary parameter.

src/conf/virnodedeviceobj.c
src/conf/virnodedeviceobj.h
src/node_device/node_device_driver.c
src/test/test_driver.c

index 4c5ee8cf356dc092ec38bfeb7edcfc416e2f6c51..035a56dad8ef3026392e176d33d1d28181fba47b 100644 (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);
     }
index 788fb6637697c173ecb33a452bb15259ddc5267a..06f2e9ec1b5dcd853e64e7aa2ed050db411d6f33 100644 (file)
@@ -75,8 +75,7 @@ virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs,
 
 int
 virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
-                                  virNodeDeviceDefPtr def,
-                              int create);
+                                  virNodeDeviceDefPtr def);
 
 virNodeDeviceObjListPtr
 virNodeDeviceObjListNew(void);
index f56ff348310bf9c501c09cabc9a58fb4485634bb..920d8776407c20ffd713f72b528e66a728ea38f3 100644 (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)
index cee7a859cf2ee2ee25de7c198130f8a2602a4d4a..94169c130ec84fca6c7d6ff0ad539305e1c2770d 100644 (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