Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit implements the API to perform FRU VPD deletion. And implements the following tasks: - API to getObjectSubTree for an interface. - Added a tag "deletion" for the FRUs that requires some actions to be performed for deleting the FRU VPD. Test: ''' 1. Before performing deletion of FRU root@p10bmc:~# busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot2/pcie_card2 NAME TYPE SIGNATURE RESULT/VALUE FLAGS com.ibm.ipzvpd.Location interface - - - .LocationCode property s "U780C.ND0.RCH0011-P0-C2" emits-change writable com.ibm.ipzvpd.VINI interface - - - .B3 property ay 6 0 0 0 0 0 0 emits-change writable .B4 property ay 1 0 emits-change writable .B7 property ay 12 0 0 0 0 0 0 0 0 0 0 0 0 emits-change writable .CC property ay 4 50 67 70 53 emits-change writable .CE property ay 1 49 emits-change writable .CT property ay 4 64 53 16 1 emits-change writable .DI property ay 0 emits-change writable .DR property ay 16 80 67 73 69 32 88 49 54 32 50 67 6... emits-change writable .FG property ay 0 emits-change writable .FN property ay 7 48 50 87 70 48 48 48 emits-change writable .HE property ay 4 48 48 48 49 emits-change writable .HW property ay 2 0 1 emits-change writable .HX property ay 9 1 2 144 144 0 0 0 0 0 emits-change writable .PN property ay 7 48 50 87 70 48 48 49 emits-change writable .PR property ay 0 emits-change writable .RT property ay 4 86 73 78 73 emits-change writable .SN property ay 12 89 76 49 49 66 71 48 65 78 48 52 71 emits-change writable .TS property ay 0 emits-change writable .VN property ay 0 emits-change writable .VZ property ay 2 48 49 emits-change writable com.ibm.ipzvpd.VMSC interface - - - .IN property ay 205 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0... emits-change writable .RT property ay 4 86 77 83 67 emits-change writable com.ibm.ipzvpd.VRTN interface - - - .I2 property ay 254 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0... emits-change writable .IN property ay 254 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0... emits-change writable .RT property ay 4 86 82 84 78 emits-change writable .SO property ay 2 0 0 emits-change writable com.ibm.ipzvpd.VSRC interface - - - .DR property ay 16 80 67 73 69 32 88 49 54 32 50 67 6... emits-change writable .IN property ay 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0... emits-change writable .RT property ay 4 86 83 82 67 emits-change writable org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - org.freedesktop.DBus.Peer interface - - - .GetMachineId method - s - .Ping method - - - org.freedesktop.DBus.Properties interface - - - .Get method ss v - .GetAll method s a{sv} - .Set method ssv - - .PropertiesChanged signal sa{sv}as - - xyz.openbmc_project.Association.Definitions interface - - - .Associations property a(sss) 2 "sensors" "inventory" "/xyz/openbmc... emits-change writable xyz.openbmc_project.Inventory.Decorator.Asset interface - - - .BuildDate property s "" emits-change writable .Manufacturer property s "" emits-change writable .Model property s "2CF5" emits-change writable .PartNumber property s "02WF001" emits-change writable .SerialNumber property s "YL11BG0AN04G" emits-change writable .SparePartNumber property s "02WF000" emits-change writable .SubModel property s "" emits-change writable xyz.openbmc_project.Inventory.Decorator.I2CDevice interface - - - .Address property u 80 emits-change writable .Bus property u 17 emits-change writable xyz.openbmc_project.Inventory.Decorator.LocationCode interface - - - .LocationCode property s "U780C.ND0.RCH0011-P0-C2" emits-change writable xyz.openbmc_project.Inventory.Decorator.Slot interface - - - .SlotNumber property u 2 emits-change writable xyz.openbmc_project.Inventory.Item interface - - - .Present property b true emits-change writable .PrettyName property s "PCIe4 x16 or PCIe5 x8 adapter" emits-change writable xyz.openbmc_project.Inventory.Item.FabricAdapter interface - - - xyz.openbmc_project.Inventory.Item.PCIeDevice interface - - - .DeviceType property s "" emits-change writable .Function0ClassCode property s "" emits-change writable .Function0DeviceClass property s "" emits-change writable .Function0DeviceId property s "" emits-change writable .Function0FunctionType property s "" emits-change writable .Function0RevisionId property s "" emits-change writable .Function0SubsystemId property s "" emits-change writable .Function0SubsystemVendorId property s "" emits-change writable .Function0VendorId property s "" emits-change writable .Function1ClassCode property s "" emits-change writable .Function1DeviceClass property s "" emits-change writable .Function1DeviceId property s "" emits-change writable .Function1FunctionType property s "" emits-change writable .Function1RevisionId property s "" emits-change writable .Function1SubsystemId property s "" emits-change writable .Function1SubsystemVendorId property s "" emits-change writable .Function1VendorId property s "" emits-change writable .Function2ClassCode property s "" emits-change writable .Function2DeviceClass property s "" emits-change writable .Function2DeviceId property s "" emits-change writable .Function2FunctionType property s "" emits-change writable .Function2RevisionId property s "" emits-change writable .Function2SubsystemId property s "" emits-change writable .Function2SubsystemVendorId property s "" emits-change writable .Function2VendorId property s "" emits-change writable .Function3ClassCode property s "" emits-change writable .Function3DeviceClass property s "" emits-change writable .Function3DeviceId property s "" emits-change writable .Function3FunctionType property s "" emits-change writable .Function3RevisionId property s "" emits-change writable .Function3SubsystemId property s "" emits-change writable .Function3SubsystemVendorId property s "" emits-change writable .Function3VendorId property s "" emits-change writable .Function4ClassCode property s "" emits-change writable .Function4DeviceClass property s "" emits-change writable .Function4DeviceId property s "" emits-change writable .Function4FunctionType property s "" emits-change writable .Function4RevisionId property s "" emits-change writable .Function4SubsystemId property s "" emits-change writable .Function4SubsystemVendorId property s "" emits-change writable .Function4VendorId property s "" emits-change writable .Function5ClassCode property s "" emits-change writable .Function5DeviceClass property s "" emits-change writable .Function5DeviceId property s "" emits-change writable .Function5FunctionType property s "" emits-change writable .Function5RevisionId property s "" emits-change writable .Function5SubsystemId property s "" emits-change writable .Function5SubsystemVendorId property s "" emits-change writable .Function5VendorId property s "" emits-change writable .Function6ClassCode property s "" emits-change writable .Function6DeviceClass property s "" emits-change writable .Function6DeviceId property s "" emits-change writable .Function6FunctionType property s "" emits-change writable .Function6RevisionId property s "" emits-change writable .Function6SubsystemId property s "" emits-change writable .Function6SubsystemVendorId property s "" emits-change writable .Function6VendorId property s "" emits-change writable .Function7ClassCode property s "" emits-change writable .Function7DeviceClass property s "" emits-change writable .Function7DeviceId property s "" emits-change writable .Function7FunctionType property s "" emits-change writable .Function7RevisionId property s "" emits-change writable .Function7SubsystemId property s "" emits-change writable .Function7SubsystemVendorId property s "" emits-change writable .Function7VendorId property s "" emits-change writable .GenerationInUse property s "xyz.openbmc_project.Inventory.Item.P... emits-change writable .GenerationSupported property s "xyz.openbmc_project.Inventory.Item.P... emits-change writable .LanesInUse property u 4294967295 emits-change writable .MaxLanes property u 0 emits-change writable xyz.openbmc_project.Object.Enable interface - - - .Enabled property b true emits-change writable xyz.openbmc_project.State.Decorator.OperationalStatus interface - - - .Functional property b true emits-change writable 2. root@p10bmc:~# busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager deleteFRUVPD o /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot2/pcie_card2 3. Journal logs: Dec 04 06:01:24 p10bmc vpd-manager[1037]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/include/utility/json_utility.hpp, Line: 280, Func: bool vpd::jsonUtility::processSystemCmdTag(const nlohmann::json_abi_v3_11_3::json&, const std::string&, const std::string&, const std::string&), Command = echo 17-0050 > /sys/bus/i2c/drivers/leds-pca955x/unbind Dec 04 06:01:24 p10bmc vpd-manager[2633]: sh: line 1: echo: write error: No such device Dec 04 06:01:24 p10bmc vpd-manager[1037]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/include/utility/json_utility.hpp, Line: 429, Func: bool vpd::jsonUtility::procesSetGpioTag(const nlohmann::json_abi_v3_11_3::json&, const std::string&, const std::string&, const std::string&), Setting GPIO: presence-cable-card2 to 0 Dec 04 06:01:24 p10bmc vpd-manager[1037]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/include/utility/json_utility.hpp, Line: 280, Func: bool vpd::jsonUtility::processSystemCmdTag(const nlohmann::json_abi_v3_11_3::json&, const std::string&, const std::string&, const std::string&), Command = echo 17-0060 > /sys/bus/i2c/drivers/at24/unbind Dec 04 06:01:24 p10bmc vpd-manager[2634]: sh: line 1: echo: write error: No such device Dec 04 06:01:24 p10bmc vpd-manager[1037]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/src/worker.cpp, Line: 1642, Func: void vpd::Worker::deleteFruVpd(const std::string&), Successfully completed deletion of FRU VPD for /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot2/pcie_card2 4. After triggering deleteFRUVPD root@p10bmc:~# busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot2/pcie_card2 NAME TYPE SIGNATURE RESULT/VALUE FLAGS com.ibm.ipzvpd.Location interface - - - .LocationCode property s "" emits-change writable com.ibm.ipzvpd.VINI interface - - - .B3 property ay 0 emits-change writable .B4 property ay 0 emits-change writable .B7 property ay 0 emits-change writable .CC property ay 0 emits-change writable .CE property ay 0 emits-change writable .CT property ay 0 emits-change writable .DI property ay 0 emits-change writable .DR property ay 0 emits-change writable .FG property ay 0 emits-change writable .FN property ay 0 emits-change writable .HE property ay 0 emits-change writable .HW property ay 0 emits-change writable .HX property ay 0 emits-change writable .PN property ay 0 emits-change writable .PR property ay 0 emits-change writable .RT property ay 0 emits-change writable .SN property ay 0 emits-change writable .TS property ay 0 emits-change writable .VN property ay 0 emits-change writable .VZ property ay 0 emits-change writable com.ibm.ipzvpd.VMSC interface - - - .IN property ay 0 emits-change writable .RT property ay 0 emits-change writable com.ibm.ipzvpd.VRTN interface - - - .I2 property ay 0 emits-change writable .IN property ay 0 emits-change writable .RT property ay 0 emits-change writable .SO property ay 0 emits-change writable com.ibm.ipzvpd.VSRC interface - - - .DR property ay 0 emits-change writable .IN property ay 0 emits-change writable .RT property ay 0 emits-change writable org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - org.freedesktop.DBus.Peer interface - - - .GetMachineId method - s - .Ping method - - - org.freedesktop.DBus.Properties interface - - - .Get method ss v - .GetAll method s a{sv} - .Set method ssv - - .PropertiesChanged signal sa{sv}as - - xyz.openbmc_project.Association.Definitions interface - - - .Associations property a(sss) 2 "sensors" "inventory" "/xyz/openbmc... emits-change writable xyz.openbmc_project.Inventory.Decorator.Asset interface - - - .BuildDate property s "" emits-change writable .Manufacturer property s "" emits-change writable .Model property s "" emits-change writable .PartNumber property s "" emits-change writable .SerialNumber property s "" emits-change writable .SparePartNumber property s "" emits-change writable .SubModel property s "" emits-change writable xyz.openbmc_project.Inventory.Decorator.I2CDevice interface - - - .Address property u 80 emits-change writable .Bus property u 17 emits-change writable xyz.openbmc_project.Inventory.Decorator.LocationCode interface - - - .LocationCode property s "U780C.ND0.RCH0011-P0-C2" emits-change writable xyz.openbmc_project.Inventory.Decorator.Slot interface - - - .SlotNumber property u 2 emits-change writable xyz.openbmc_project.Inventory.Item interface - - - .Present property b false emits-change writable .PrettyName property s "" emits-change writable xyz.openbmc_project.Inventory.Item.FabricAdapter interface - - - xyz.openbmc_project.Inventory.Item.PCIeDevice interface - - - .DeviceType property s "" emits-change writable .Function0ClassCode property s "" emits-change writable .Function0DeviceClass property s "" emits-change writable .Function0DeviceId property s "" emits-change writable .Function0FunctionType property s "" emits-change writable .Function0RevisionId property s "" emits-change writable .Function0SubsystemId property s "" emits-change writable .Function0SubsystemVendorId property s "" emits-change writable .Function0VendorId property s "" emits-change writable .Function1ClassCode property s "" emits-change writable .Function1DeviceClass property s "" emits-change writable .Function1DeviceId property s "" emits-change writable .Function1FunctionType property s "" emits-change writable .Function1RevisionId property s "" emits-change writable .Function1SubsystemId property s "" emits-change writable .Function1SubsystemVendorId property s "" emits-change writable .Function1VendorId property s "" emits-change writable .Function2ClassCode property s "" emits-change writable .Function2DeviceClass property s "" emits-change writable .Function2DeviceId property s "" emits-change writable .Function2FunctionType property s "" emits-change writable .Function2RevisionId property s "" emits-change writable .Function2SubsystemId property s "" emits-change writable .Function2SubsystemVendorId property s "" emits-change writable .Function2VendorId property s "" emits-change writable .Function3ClassCode property s "" emits-change writable .Function3DeviceClass property s "" emits-change writable .Function3DeviceId property s "" emits-change writable .Function3FunctionType property s "" emits-change writable .Function3RevisionId property s "" emits-change writable .Function3SubsystemId property s "" emits-change writable .Function3SubsystemVendorId property s "" emits-change writable .Function3VendorId property s "" emits-change writable .Function4ClassCode property s "" emits-change writable .Function4DeviceClass property s "" emits-change writable .Function4DeviceId property s "" emits-change writable .Function4FunctionType property s "" emits-change writable .Function4RevisionId property s "" emits-change writable .Function4SubsystemId property s "" emits-change writable .Function4SubsystemVendorId property s "" emits-change writable .Function4VendorId property s "" emits-change writable .Function5ClassCode property s "" emits-change writable .Function5DeviceClass property s "" emits-change writable .Function5DeviceId property s "" emits-change writable .Function5FunctionType property s "" emits-change writable .Function5RevisionId property s "" emits-change writable .Function5SubsystemId property s "" emits-change writable .Function5SubsystemVendorId property s "" emits-change writable .Function5VendorId property s "" emits-change writable .Function6ClassCode property s "" emits-change writable .Function6DeviceClass property s "" emits-change writable .Function6DeviceId property s "" emits-change writable .Function6FunctionType property s "" emits-change writable .Function6RevisionId property s "" emits-change writable .Function6SubsystemId property s "" emits-change writable .Function6SubsystemVendorId property s "" emits-change writable .Function6VendorId property s "" emits-change writable .Function7ClassCode property s "" emits-change writable .Function7DeviceClass property s "" emits-change writable .Function7DeviceId property s "" emits-change writable .Function7FunctionType property s "" emits-change writable .Function7RevisionId property s "" emits-change writable .Function7SubsystemId property s "" emits-change writable .Function7SubsystemVendorId property s "" emits-change writable .Function7VendorId property s "" emits-change writable .GenerationInUse property s "xyz.openbmc_project.Inventory.Item.P... emits-change writable .GenerationSupported property s "xyz.openbmc_project.Inventory.Item.P... emits-change writable .LanesInUse property u 4294967295 emits-change writable .MaxLanes property u 0 emits-change writable xyz.openbmc_project.Object.Enable interface - - - .Enabled property b true emits-change writable xyz.openbmc_project.State.Decorator.OperationalStatus interface - - - .Functional property b true emits-change writable ''' Signed-off-by: RekhaAparna01 <[email protected]>
- Loading branch information