diff options
Diffstat (limited to 'src/hardware/LMI_PCIDeviceSystemDeviceProvider.c')
-rw-r--r-- | src/hardware/LMI_PCIDeviceSystemDeviceProvider.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c b/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c index cf8634c..1f5372f 100644 --- a/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c +++ b/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c @@ -28,9 +28,9 @@ static const CMPIBroker* _cb; struct pci_access *acc_system_dev = NULL; -static void LMI_PCIDeviceSystemDeviceInitialize() +static void LMI_PCIDeviceSystemDeviceInitialize(const CMPIContext *ctx) { - lmi_init(provider_name, _cb, provider_config_defaults); + lmi_init(provider_name, _cb, ctx, provider_config_defaults); if (init_pci_access(&acc_system_dev, PCI_FILL_CLASS) != 0) { error("Failed to access the PCI bus."); @@ -66,21 +66,11 @@ static CMPIStatus LMI_PCIDeviceSystemDeviceEnumInstances( const char** properties) { LMI_PCIDeviceSystemDevice lmi_pci_sys_device; - CIM_ComputerSystemRef cim_cs; LMI_PCIDeviceRef lmi_dev; - CMPIObjectPath *o; - CMPIStatus st; const char *ns = KNameSpace(cop); struct pci_dev *dev; char device_id_str[PCI_DEVID_STR_SIZE]; - CIM_ComputerSystemRef_Init(&cim_cs, _cb, ns); - CIM_ComputerSystemRef_Set_Name(&cim_cs, get_system_name()); - CIM_ComputerSystemRef_Set_CreationClassName(&cim_cs, - get_system_creation_class_name()); - o = CIM_ComputerSystemRef_ToObjectPath(&cim_cs, &st); - CMSetClassName(o, get_system_creation_class_name()); - for (dev = acc_system_dev->devices; dev; dev = dev->next) { /* Ignore PCI Bridges */ /* Throw away the lower 8 bits denoting the subclass */ @@ -102,7 +92,7 @@ static CMPIStatus LMI_PCIDeviceSystemDeviceEnumInstances( LMI_PCIDeviceRef_Set_DeviceID(&lmi_dev, device_id_str); LMI_PCIDeviceSystemDevice_SetObjectPath_GroupComponent( - &lmi_pci_sys_device, o); + &lmi_pci_sys_device, lmi_get_computer_system()); LMI_PCIDeviceSystemDevice_Set_PartComponent(&lmi_pci_sys_device, &lmi_dev); @@ -264,13 +254,13 @@ CMInstanceMIStub( LMI_PCIDeviceSystemDevice, LMI_PCIDeviceSystemDevice, _cb, - LMI_PCIDeviceSystemDeviceInitialize()) + LMI_PCIDeviceSystemDeviceInitialize(ctx)) CMAssociationMIStub( LMI_PCIDeviceSystemDevice, LMI_PCIDeviceSystemDevice, _cb, - LMI_PCIDeviceSystemDeviceInitialize()) + LMI_PCIDeviceSystemDeviceInitialize(ctx)) KONKRET_REGISTRATION( "root/cimv2", |