提交 7c40ed4a 编写于 作者: J John Ferlan

nodedev: Alter param to nodeDeviceUpdateCaps

Rather than taking an virNodeDeviceObjPtr and dereffing the obj->def,
just pass the def.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 381bbfbb
......@@ -49,9 +49,9 @@ virNodeDeviceDriverStatePtr driver;
static int
nodeDeviceUpdateCaps(virNodeDeviceObjPtr dev)
nodeDeviceUpdateCaps(virNodeDeviceDefPtr def)
{
virNodeDevCapsDefPtr cap = dev->def->caps;
virNodeDevCapsDefPtr cap = def->caps;
while (cap) {
switch (cap->data.type) {
......@@ -59,7 +59,7 @@ nodeDeviceUpdateCaps(virNodeDeviceObjPtr dev)
nodeDeviceSysfsGetSCSIHostCaps(&cap->data.scsi_host);
break;
case VIR_NODE_DEV_CAP_SCSI_TARGET:
nodeDeviceSysfsGetSCSITargetCaps(dev->def->sysfs_path,
nodeDeviceSysfsGetSCSITargetCaps(def->sysfs_path,
&cap->data.scsi_target);
break;
case VIR_NODE_DEV_CAP_NET:
......@@ -70,7 +70,7 @@ nodeDeviceUpdateCaps(virNodeDeviceObjPtr dev)
return -1;
break;
case VIR_NODE_DEV_CAP_PCI_DEV:
if (nodeDeviceSysfsGetPCIRelatedDevCaps(dev->def->sysfs_path,
if (nodeDeviceSysfsGetPCIRelatedDevCaps(def->sysfs_path,
&cap->data.pci_dev) < 0)
return -1;
break;
......@@ -355,7 +355,7 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr dev,
if (nodeDeviceUpdateDriverName(obj->def) < 0)
goto cleanup;
if (nodeDeviceUpdateCaps(obj) < 0)
if (nodeDeviceUpdateCaps(obj->def) < 0)
goto cleanup;
ret = virNodeDeviceDefFormat(obj->def);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册