entity-manager unexpected handling of template parameters

James Feist james.feist at linux.intel.com
Sat Aug 10 06:21:01 AEST 2019


On 8/9/19 12:30 PM, Patrick Venture wrote:
> On Fri, Aug 9, 2019 at 12:24 PM Patrick Venture <venture at google.com> wrote:
>>
>> On Fri, Aug 9, 2019 at 12:20 PM Patrick Venture <venture at google.com> wrote:
>>>
>>> On Fri, Aug 9, 2019 at 11:57 AM Patrick Venture <venture at google.com> wrote:
>>>>
>>>> On Fri, Aug 9, 2019 at 11:50 AM Patrick Venture <venture at google.com> wrote:
>>>>>
>>>>> On Fri, Aug 9, 2019 at 11:45 AM James Feist <james.feist at linux.intel.com> wrote:
>>>>>>
>>>>>> On 8/9/19 11:33 AM, Patrick Venture wrote:
>>>>>>> On Fri, Aug 9, 2019 at 11:22 AM James Feist <james.feist at linux.intel.com> wrote:
>>>>>>>>
>>>>>>>> On 8/9/19 9:53 AM, Patrick Venture wrote:
>>>>>>>>> Given the following:
>>>>>>>>>
>>>>>>>>> busctl introspect --no-pager xyz.openbmc_project.FruDevice
>>>>>>>>> /xyz/openbmc_project/FruDevice/Altie
>>>>>>>>> NAME                                TYPE      SIGNATURE RESULT/VALUE
>>>>>>>>>                FLAGS
>>>>>>>>> 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.FruDevice       interface -         -
>>>>>>>>>                -
>>>>>>>>> .ADDRESS                            property  u         82
>>>>>>>>>                emits-change
>>>>>>>>> .BOARD_LANGUAGE_CODE                property  s         "25"
>>>>>>>>>                emits-change
>>>>>>>>> .BOARD_MANUFACTURER                 property  s         "Inventec"
>>>>>>>>>                emits-change
>>>>>>>>> .BOARD_MANUFACTURE_DATE             property  s         "Thu Jul 11
>>>>>>>>> 17:09:00 2019" emits-change
>>>>>>>>> .BOARD_PART_NUMBER                  property  s         "1051867-01"
>>>>>>>>>                emits-change
>>>>>>>>> .BOARD_PRODUCT_NAME                 property  s         "Altie"
>>>>>>>>>                emits-change
>>>>>>>>> .BOARD_SERIAL_NUMBER                property  s
>>>>>>>>> "ALTIVT192700026"          emits-change
>>>>>>>>> .BUS                                property  u         1
>>>>>>>>>                emits-change
>>>>>>>>> .Common_Format_Version              property  s         "1"
>>>>>>>>>                emits-change
>>>>>>>>>
>>>>>>>>> I expected entity-manager with this profile to populate dbus properly:
>>>>>>>>> configurations/altie.json
>>>>>>>>> {
>>>>>>>>>        "Name" : "Altie",
>>>>>>>>>        "Probe" : "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Altie'})",
>>>>>>>>>        "Type": "Board",
>>>>>>>>>        "xyz.openbmc_project.Inventory.Decorator.Asset": {
>>>>>>>>>            "Manufacturer": "$BOARD_MANUFACTURER",
>>>>>>>>>            "Model": "$BOARD_PRODUCT_NAME",
>>>>>>>>>            "PartNumber": "$BOARD_PART_NUMBER",
>>>>>>>>>            "SerialNumber": "$BOARD_SERIAL_NUMBER"
>>>>>>>>>        }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Instead:
>>>>>>>>> root at semitruck:~# busctl introspect --no-pager
>>>>>>>>> xyz.openbmc_project.EntityManager
>>>>>>>>> /xyz/openbmc_project/inventory/system/board/Altie
>>>>>>>>> NAME                                          TYPE      SIGNATURE
>>>>>>>>> RESULT/VALUE                             FLAGS
>>>>>>>>> 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.AddObject                 interface -         -
>>>>>>>>>                                        -
>>>>>>>>> .AddObject                                    method    a{sv}     -
>>>>>>>>>                                        -
>>>>>>>>> xyz.openbmc_project.Inventory.Decorator.Asset interface -         -
>>>>>>>>>                                        -
>>>>>>>>> .Manufacturer                                 property  s
>>>>>>>>> "$BOARD_MANUFACTURER"                    emits-change
>>>>>>>>> .Model                                        property  s
>>>>>>>>> "$BOARD_PRODUCT_NAME"                    emits-change
>>>>>>>>> .PartNumber                                   property  s
>>>>>>>>> "$BOARD_PART_NUMBER"                     emits-change
>>>>>>>>> .SerialNumber                                 property  s
>>>>>>>>> "$BOARD_SERIAL_NUMBER"                   emits-change
>>>>>>>>> xyz.openbmc_project.Inventory.Item.Board      interface -         -
>>>>>>>>>                                        -
>>>>>>>>> .Name                                         property  s
>>>>>>>>> "Altie"                                  emits-change
>>>>>>>>> .Probe                                        property  s
>>>>>>>>> "xyz.openbmc_project.FruDevice({\'BOA... emits-change
>>>>>>>>> .Type                                         property  s
>>>>>>>>> "Board"                                  emits-change
>>>>>>>>>
>>>>>>>>> I must be doing something obvious and silly.  Please advise.
>>>>>>>>
>>>>>>>> Entity-manager caches the result and only updates if etc/os-release
>>>>>>>> changes. There is a version file in /var/configuration/version, if you
>>>>>>>> delete this it'll rescan fresh. It looks right to me.. so I imagine this
>>>>>>>> is what is happening.
>>>>>>>
>>>>>>> I deleted the /var/configuration/version file and rebooted the BMC.
>>>>>>> it didn't pick it up -- I decided a rescan was too subtle :)
>>>>>>>
>>>>>>> Any other ideas?  I've started digging into entity-manager further.
>>>>>>
>>>>>> Sorry I don't see anything obvious... it should all be happening in this
>>>>>> function
>>>>>> https://github.com/openbmc/entity-manager/blob/b295e1d8385544f12a436ef63153d373ff8de625/src/EntityManager.cpp#L1130
>>>>>>
>>>>>>
>>>>>> Specifically it should be making it to here:
>>>>>>
>>>>>> https://github.com/openbmc/entity-manager/blob/b295e1d8385544f12a436ef63153d373ff8de625/src/EntityManager.cpp#L1291
>>>>>
>>>>> Thanks, that's where I'm now looking --
>>>>
>>>> I deleted everything from /var/configuration/ rebooted, and added some
>>>> debug to dig into the specific template replacement:
>>>>
>>>> Aug 09 18:51:47 semitruck entity-manager[2700]: strPtr value:
>>>> '$BOARD_MANUFACTURER'
>>>> Aug 09 18:51:47 semitruck entity-manager[2700]: templateName:
>>>> $BOARD_MANUFACTURER, find: true
>>>> Aug 09 18:51:47 semitruck entity-manager[2700]: keyPair.value(): "Inventec"
>>>>
>>>> Aug 09 18:51:47 semitruck entity-manager[2700]: strPtr value:
>>>> '$BOARD_PRODUCT_NAME'
>>>> Aug 09 18:51:47 semitruck entity-manager[2700]: templateName:
>>>> $BOARD_PRODUCT_NAME, find: true
>>>> Aug 09 18:51:47 semitruck entity-manager[2700]: keyPair.value(): "Altie"
>>>
>>> So the visitor is finding and applying the value to the template, but
>>> that change isn't propagating up.  It works for the card that's found
>>> afterwards...  The only real difference is, the other profile also
>>> Exposes, whereas this one doesn't.  Is there a step that's skipped if
>>> there isn't an "Exposes" key?
>>
>> Looks like this part is skipped:
>> https://github.com/openbmc/entity-manager/blob/b295e1d8385544f12a436ef63153d373ff8de625/src/EntityManager.cpp#L1618
>>
>> _systemConfiguration[recordName] = record;
>> logDeviceAdded(record);
>> foundDeviceIdx++;
> 
> I think foundDeviceIdx is the culprit because it isnt' always
> incremented.  So, I've moved that before the contnue.

I think you're close.. I think this line is your issue if you have no 
exposes:

https://github.com/openbmc/entity-manager/blob/b295e1d8385544f12a436ef63153d373ff8de625/src/EntityManager.cpp#L1539

you need to hit here regardless:
https://github.com/openbmc/entity-manager/blob/b295e1d8385544f12a436ef63153d373ff8de625/src/EntityManager.cpp#L1619

That continue should just be removed.


> 
>>
>> Hm.
>>
>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>>
>>>>>> foundDevice should be your fru.... and should be populated here:
>>>>>>
>>>>>> https://github.com/openbmc/entity-manager/blob/b295e1d8385544f12a436ef63153d373ff8de625/src/EntityManager.cpp#L425
>>>>>
>>>>> I did not think to look here, thanks!
>>>>>
>>>>>>
>>>>>> Hope that helps
>>>>>>
>>>>>> -James
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> -James
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Patrick
>>>>>>>>>


More information about the openbmc mailing list