Skip to content
  1. May 12, 2023
    • Lakshmi Yadlapati's avatar
      Fix invalid PCIeType in pcie_slots · bbf372a6
      Lakshmi Yadlapati authored
      When the Generation field of a PCIeSlot object in D-Bus is set to
      "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown",
      pcie_slots was returning an invalid PCIeType of "false". This caused
      the Redfish validator to fail. To resolve this, the code has been
      updated to not return the PCIeType if the Generation field is empty
      or unknown.
      
      Tested: Validator passed
      '''
      busctl get-property -j xyz.openbmc_project.Inventory.Manager \
      /xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \
      xyz.openbmc_project.Inventory.Item.PCIeSlot Generation
      {
              "type" : "s",
              "data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown"
      }
      
      curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
      {
        "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
        "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
        "Id": "1",
        "Name": "PCIe Slot Information",
        "Slots": [
          {
            "HotPluggable": false,
            "Lanes": 0,
            "SlotType": "U2"
          },
      .....
      }
      
      busctl set-property  xyz.openbmc_project.Inventory.Manager \
      /xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \
      xyz.openbmc_project.Inventory.Item.PCIeSlot Generation s \
      xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen1
      
      curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
      
      
      {
        "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
        "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
        "Id": "1",
        "Name": "PCIe Slot Information",
        "Slots": [
          {
            "HotPluggable": false,
            "Lanes": 0,
            "PCIeType": "Gen1",
            "SlotType": "U2"
          },
      ....
      }
      '''
      
      Change-Id: I143ce7e90cf24447a667a09d946e42f00c091a64
      Signed-off-by: default avatarLakshmi Yadlapati <lakshmiy@us.ibm.com>
      bbf372a6
    • Lakshmi Yadlapati's avatar
      Add State information for PCIeDevice · c6bb3285
      Lakshmi Yadlapati authored
      This commit is to add state information according to the Redfish
      PCIeDevice schema. Default state is "Enabled".
      ref: https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_9_0.json
      
      Tested: Validator passed
      
      '''
       curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8
      
      
      {
        "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8",
        "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
        "Id": "pcie_card8",
        "Manufacturer": "",
        "Model": "6B87",
        "Name": "PCIe Device",
        "PCIeFunctions": {
          "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8/PCIeFunctions"
        },
        "PCIeInterface": {
          "LanesInUse": -1
        },
        "PartNumber": "03FL194",
        "SerialNumber": "Y131UF09S00J",
        "Slot": {
          "Location": {
            "PartLocation": {
              "ServiceLabel": "U78DB.ND0.WZS0018-P0-C8"
            }
          }
        },
        "SparePartNumber": "03FL195",
        "Status": {
          "Health": "OK",
          "State": "Enabled"
        }
      }
      '''
      
      Change-Id: Ibee01345c81c2e824fc2387c4f27e421b3f4c507
      Signed-off-by: default avatarLakshmi Yadlapati <lakshmiy@us.ibm.com>
      c6bb3285
    • Lakshmi Yadlapati's avatar
      Remove "Manufacturer" from PCIeDevice interface · bad2c4a9
      Lakshmi Yadlapati authored
      Remove Manufacturer from the PCIeDevice's PCIeInterface and fix the
      following Redfish validator error:
      ERROR - Manufacturer not defined in Complex PCIeInterface
      PCIeDevice.v1_3_0.PCIeInterface (check version, spelling and casing)
      
      This error is because there is no ["PCIeInterface"]["Manufacturer"] at
      https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_11_0.json.
      
      "Manufacturer" is already part of the root PCIeDevice and is
      implemented on line 219.
      
      On the backend "Manufacturer" is already part of Asset interface so
      remove it from PCIeDevice interface in peci-pcie and
      phosphor-dbus-interface.
      
      phosphor-dbus-interfaces commit:
      https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/61738
      
      peci-pcie commit:
      https://gerrit.openbmc.org/c/openbmc/peci-pcie/+/62256
      
      Tested:
      ```
      curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card10
      
      
      {
        "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10",
        "@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
        "Id": "pcie_card10",
        "Manufacturer": "",
        "Model": "6B87",
        "Name": "PCIe Device",
        "PCIeFunctions": {
          "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10/PCIeFunctions"
        },
        "PCIeInterface": {
          "LanesInUse": 16,
          "PCIeType": "Gen4"
        },
        "PartNumber": "03FL204",
        "SerialNumber": "YA31UF07200Z",
        "Slot": {
          "Location": {
            "PartLocation": {
              "ServiceLabel": "U78DA.ND0.WZS003T-P0-C10"
            }
          }
        },
        "SparePartNumber": "03FL205"
      }
      ```
      
      Change-Id: I860bf60f6fa3cc5d6b57f945d781e7dcafc17d7f
      Signed-off-by: default avatarLakshmi Yadlapati <lakshmiy@us.ibm.com>
      bad2c4a9
    • Ed Tanous's avatar
      Revert "http_connection: Allow empty json objects" · b84e729d
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      This reverts commit 02e01b51.
      
      This commit is being reverted because it causes login failures on
      Firefox browsers.  This commit originally was added with the idea that
      it did not fix anything on upstream, but made some peoples forks better.
      
      It appears to have broken some upstream things, so the right thing to do
      is to revert it until those breakages can be understood.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I04de84fca1a8de657f6941653f2a3e595ee725d5
      b84e729d
    • Ed Tanous's avatar
      Update RedfishVersion to 1.17.0 · c16e292c
      Ed Tanous authored
      
      
      The latest version of the specification is 1.17.0, and arguably, we
      should be updating this every time we pull in any new feature, but that
      hasn't happened.
      
      So far as I'm aware, there are no tools that actually look at this
      parameter to make branching decisions in the client about supported
      features, so the likelihood this has impact is basically nil.
      
      Tested:
      GET /redfish/v1 returns RedfishVersion of 1.17.0
      
      Redfish service validator passes.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I055b6010329599b7b39c587fa85faf51a38c9b57
      c16e292c
    • Patrick Williams's avatar
      fix more push vs emplace calls · b2ba3072
      Patrick Williams authored
      
      
      It seems like clang-tidy doesn't catch every place that an emplace could
      be used instead of a push.  Use a few grep/sed pairs to find and fix up
      some common patterns.
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I93eaec26b8e3be240599e92b66cf54947073dc4c
      b2ba3072
    • Patrick Williams's avatar
      systems: remove stray break for clang-tidy · bc6cfec5
      Patrick Williams authored
      
      
      clang-tidy warns as follows:
      
      ```
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/redfish-core/lib/systems.hpp:292:13: error: loop will run at most once (loop increment never executed) [clang-diagnostic-unreachable-code-loop-increment,-warnings-as-errors]
                  for (const auto& connection : connectionNames)
      ```
      
      It seems as though the break is stray so remove it.
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Iafafb6634819a7f37a1cdd9c4a93e1c426d5dfc5
      bc6cfec5
    • Patrick Williams's avatar
      ibm-locks: shut up clang-tidy by disabling code · 26b3630b
      Patrick Williams authored
      
      
      There is code in ibm/locks that has had clang-tidy warnings disabled
      for a while due to multiple safety and endianness issues.  The code
      has not been fixed in a while and with clang-16 it is unable to be
      exempted further.  Disable it until someone who cares can fix this
      in the proper way.
      
      ```
      ../include/ibm/locks.hpp:522:14: error: 'p' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
          uint8_t* p = reinterpret_cast<uint8_t*>(&resourceId1);
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../include/ibm/locks.hpp:527:25: note: used in buffer access here
          uint8_t pPosition = p[position];
                              ^
      ../include/ibm/locks.hpp:524:14: error: 'q' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
          uint8_t* q = reinterpret_cast<uint8_t*>(&resourceId2);
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../include/ibm/locks.hpp:529:25: note: used in buffer access here
          uint8_t qPosition = q[position];
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I8a7fcbed1099419ad1715c86ffcbfef20820251e
      26b3630b
    • Patrick Williams's avatar
      use emplace where appropriate per clang-tidy · ad539545
      Patrick Williams authored
      
      
      The clang-tidy warning 'modernize-use-emplace' correctly flags a
      few places where emplace should be used over push.
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I6ca79285a87d6927e718345dc8dce0387e6b1eda
      ad539545
    • Patrick Williams's avatar
      fix clang-tidy warnings with unreachable returns · 65a176cd
      Patrick Williams authored
      
      
      ```
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/verb.hpp:51:12: error: 'return' will never be executed [clang-diagnostic-unreachable-code-return,-warnings-as-errors]
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/utility.hpp:99:12: error: 'return' will never be executed [clang-diagnostic-unreachable-code-return,-warnings-as-errors]
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/redfish-core/include/utils/query_param.hpp:272:13: error: 'break' will never be executed [clang-diagnostic-unreachable-code-break,-warnings-as-errors]
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Ia74f4fb4f34875097d1ef04b26e40908cc175088
      65a176cd
    • Patrick Williams's avatar
      chassis: fix clang-tidy warning · 840a9ffc
      Patrick Williams authored
      
      
      ```
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/redfish-core/lib/chassis.hpp:130:13: error: loop will run at most once (loop increment never executed) [clang-diagnostic-unreachable-code-loop-increment,-warnings-as-errors]
                  for (const auto& service : object.second)
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I3d7743115ec31d6f704a857f3e878fa1b7728a60
      840a9ffc
    • Patrick Williams's avatar
      http-app: fix unused macro clang-tidy warning · a232343d
      Patrick Williams authored
      
      
      ```
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/app.hpp:27:9: error: macro is not used [clang-diagnostic-unused-macros,-warnings-as-errors]
       #define BMCWEB_ROUTE(app, url)
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I49b6239d7d5f31c52af6f6e5b0bc57be22a299b5
      a232343d
    • Patrick Williams's avatar
      http-logging: fix clang-tidy warnings · eb8a3998
      Patrick Williams authored
      
      
      ```
      /data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/logging.hpp:132:9: error: macro is not used [clang-diagnostic-unused-macros,-warnings-as-errors]
       #define BMCWEB_LOG_CRITICAL
      ```
      
      Add NOLINTBEGIN/NOLINTEND guards around the whole of the macro
      definitions because there are now multiple clang-tidy warning types
      that call out this behavior, but we want it in this case.
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Iac2ee839999f36424ca6dfed212d0bad0a2f3ae5
      eb8a3998
    • Patrick Williams's avatar
      certificate-service: fix clang-tidy warnings · 6da47bab
      Patrick Williams authored
      
      
      ```
      ../redfish-core/lib/certificate_service.hpp:154:32: error: 'i' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
          std::string_view::iterator i = value.begin();
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I6b6fb17d58bb7a3bd861aaf020540586490693da
      6da47bab
    • Ed Tanous's avatar
      Don't rely on implicit operator comparison · 6a0dd33d
      Ed Tanous authored
      
      
      Json has a bunch of implicit overloaded operators for comparing
      vectors/arrays/maps with their json counterparts.  Unfortunately, when
      used in unit tests, these cause warnings in clang, so update the code to
      use the ElementsAre check from gmock.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I658557cb59d568fd50cf6f3bef73d6f90b5c56cf
      6a0dd33d
    • Patrick Williams's avatar
      log-services: fix clang-tidy warnings · 84396af9
      Patrick Williams authored
      
      
      A number of similar warnings about unsafe pointer arithmetic.
      
      ```
      ../redfish-core/lib/log_services.hpp:269:39: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
                  indexStr.data(), indexStr.data() + indexStr.size(), index);
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Icc4a0d2f418c76d6987ef2318b0098d30d116389
      84396af9
  2. May 11, 2023
    • Patrick Williams's avatar
      query-param: fix clang-tidy warnings · 2bd4ab43
      Patrick Williams authored
      
      
      ```
      ../redfish-core/include/utils/query_param.hpp:287:51: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
          auto it = std::from_chars(value.data(), value.data() + value.size(),
                                                  ~~~~~~^~~~~~
      ../redfish-core/include/utils/query_param.hpp:307:45: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
              std::from_chars(value.data(), value.data() + value.size(), param);
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Ic93d3e98e0539f5c7068b93ff7e4505fdd5bbfe1
      2bd4ab43
    • Patrick Williams's avatar
      json-html-serializer: fix clang-tidy warning · 84ea4b10
      Patrick Williams authored
      
      
      ```
      ../include/json_html_serializer.hpp:426:42: error: 'end' declared with a const-qualified typedef; results in the type being 'char *const' instead of 'const char *' [misc-misplaced-const,-warnings-as-errors]
          const std::array<char, 64>::iterator end =
                                               ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/array:106:44: note: typedef declared here
            typedef value_type*                             iterator;
      ../include/json_html_serializer.hpp:165:60: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
                                      std::snprintf(stringBuffer.data() + bytes, 7,
      ../include/json_html_serializer.hpp:327:11: error: 'bufferPtr' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
          auto* bufferPtr = begin(numberbuffer);
      ../include/json_html_serializer.hpp:393:11: error: 'begin' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
          char* begin = numberbuffer.data();
      ../include/json_html_serializer.hpp:425:56: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
              std::remove(numberbuffer.begin(), numberbuffer.begin() + len, ',');
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: If6aaf038c939ad76da73e68e746a56b0905b2804
      84ea4b10
    • Patrick Williams's avatar
      mutual-tls: fix clang-tidy warning · 3d7fc71e
      Patrick Williams authored
      
      
      ```
      ../http/mutual_tls.hpp:77:35: error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
              unsigned char usageChar = usage->data[i];
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Icc6905f31fdd54b683fe7807eb72e9b78437b2d1
      3d7fc71e
    • Patrick Williams's avatar
      pam-authenticate: fix clang-tidy warning · ad7fa902
      Patrick Williams authored
      
      
      ```
      ../include/pam_authenticate.hpp:11:75: error: 'msg' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
      inline int pamFunctionConversation(int numMsg, const struct pam_message** msg,
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Ic0e6d63b01eea78cac54407246363177cb208f8b
      ad7fa902
    • Patrick Williams's avatar
      multipart-parser: fix clang-tidy issues · 0e31e952
      Patrick Williams authored
      
      
      ```
      ../include/multipart_parser.hpp:77:21: error: 'buffer' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
              const char* buffer = req.body().data();
      ../include/multipart_parser.hpp:246:38: error: 'buffer' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
          void skipNonBoundary(const char* buffer, size_t len, size_t boundaryEnd,
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Iad3b4b241ec75a152e240755a307a970798079fb
      0e31e952
    • Patrick Williams's avatar
      time-utils: fix clang-tidy warning · 97c920c5
      Patrick Williams authored
      
      
      The code already does size checking to ensure that buffer overruns
      are not done, so switch to using operator[] rather than pointer
      arithmetic.
      
      ```
      ../redfish-core/include/utils/time_utils.hpp:71:19: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
              end = fmt.data() + pos;
      ```
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: Iaabe82d7c1621dc27ad10288732609dfd0516d17
      97c920c5
  3. May 10, 2023
    • Patrick Williams's avatar
      human-sort: fix clang-tidy warnings about pointer arithmetic · d13f468c
      Patrick Williams authored
      
      
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      Change-Id: I8122bfffaac469ee551c72632b671e8644a4da44
      d13f468c
    • Patrick Williams's avatar
      clang-format: copy latest and re-format · 89492a15
      Patrick Williams authored
      
      
      clang-format-16 has some backwards incompatible changes that require
      additional settings for best compatibility and re-running the formatter.
      Copy the latest .clang-format from the docs repository and reformat the
      repository.
      
      Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835
      Signed-off-by: default avatarPatrick Williams <patrick@stwcx.xyz>
      89492a15
    • Potin Lai's avatar
      managers: fix bug of searching dbus object path · cddbf3df
      Potin Lai authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Notice a bug of patching existed object if the object name contains
      space or underscore.
      
      Normally dbus replace space with underscore for object path.
      Replacing all spaces in input name with underscore to find the correct
      dbus object path.
      
      Tested results:
      
      - Add new object
      Input JSON
      ```
      {
          "Oem": {
              "OpenBmc": {
                  "Fan": {
                      "StepwiseControllers": {
                          "Test_1": {
                              "Direction": "Floor",
                              "Inputs": [
                                  "MB_U402_THERM_LOCAL"
                              ],
                              "NegativeHysteresis": 0.0,
                              "PositiveHysteresis": 0.0,
                              "Steps": [
                                  {
                                      "Output": 0.0,
                                      "Target": 48.0
                                  },
                                  {
                                      "Output": 40.0,
                                      "Target": 52.0
                                  }
                              ],
                              "Zones": [
                                  {
                                      "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0"
                                  }
                              ]
                          }
                      }
                  }
              }
          }
      }
      ```
      
      Check result from /redfish/v1/Managers/bmc
      ```
      "Test_1": {
          "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/StepwiseControllers/Test_1",
          "@odata.type": "#OemManager.StepwiseController",
          "Direction": "Floor",
          "Inputs": [
              "MB U402 THERM LOCAL"
          ],
          "NegativeHysteresis": 0.0,
          "PositiveHysteresis": 0.0,
          "Steps": [
              {
                  "Output": 0.0,
                  "Target": 48.0
              },
              {
                  "Output": 40.0,
                  "Target": 52.0
              }
          ],
          "Zones": [
              {
                  "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0"
              }
          ]
      }
      ```
      
      - Patching existed object successful
      Input JSON
      ```
      {
          "Oem": {
              "OpenBmc": {
                  "Fan": {
                      "StepwiseControllers": {
                          "Test_1": {
                              "NegativeHysteresis": 0.0,
                              "PositiveHysteresis": 5.0,
                          }
                      }
                  }
              }
          }
      }
      ```
      
      Check result from /redfish/v1/Managers/bmc
      ```
      "Test_1": {
          "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/StepwiseControllers/Test_1",
          "@odata.type": "#OemManager.StepwiseController",
          "Direction": "Floor",
          "Inputs": [
              "MB U402 THERM LOCAL"
          ],
          "NegativeHysteresis": 0.0,
          "PositiveHysteresis": 5.0,
          "Steps": [
              {
                  "Output": 0.0,
                  "Target": 48.0
              },
              {
                  "Output": 40.0,
                  "Target": 52.0
              }
          ],
          "Zones": [
              {
                  "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0"
              }
          ]
      }
      ```
      
      Signed-off-by: default avatarPotin Lai <potin.lai@quantatw.com>
      Change-Id: I12c78e52801bd0814ba2d928cf020e0a04214c39
      cddbf3df
  4. May 05, 2023
    • Myung Bae's avatar
      Update Logging option for the setting log level · 662aa6e3
      Myung Bae authored and Ed Tanous's avatar Ed Tanous committed
      
      
      In order to be able to more easily debug bmcweb related issue,
      a new meson option is added to set a specific logging level
      Which generates the targeted logging traces rather than all of
      debug traces.
      
      The current option -Dbmcweb-logging which can be either
      disabled or enabled is changed to  allow  to set the log level
      for the specific level traces (e.g. error or critical traces)
      to be written to the journal.
      
           -Dbmcweb-logging=<log-level>
      
      where <log-level> can be disabled, enabled, debug, info,
            warning, error, or critical.
      
      - `disabled`: Turns off all bmcweb log traces.
      - `enabled` : treated as `debug`
      - Other option can be described in
        [Logging Levels](DEVELOPING.md).
      
      For an example, to enable only 'error', 'critical' log
      entries, bmcweb can be built with
      
          -Dbmcweb-logging=error
      
      Testing:
      - Verified that only the specific logs (e.g. error and
        critical logs) were displayed by compiling bmcweb with the
        specific bmcweb-logging level.
      
      Change-Id: I522ca26700ea420fee1a5cf688d3e8c6661f2f55
      Signed-off-by: default avatarMyung Bae <myungbae@us.ibm.com>
      662aa6e3
  5. May 04, 2023
    • Alexander Hansen's avatar
      bugfix: find existing powersupply for power sensor · f7afb17b
      Alexander Hansen authored and Ed Tanous's avatar Ed Tanous committed
      
      
      Fix lookup for existing powersupplies
      when building json. (dbus: '_' , json: ' ')
      
      Tested: manually with 2 Supermicro Power Supplies.
      
      Change-Id: Iecd14c0b9860a12c64b004c99cb6a7fb1dd0328a
      Signed-off-by: default avatarAlexander Hansen <alexander.hansen@9elements.com>
      f7afb17b
    • Lakshmi Yadlapati's avatar
      Update depth parameter in getPCIeDeviceList · 38e3d67d
      Lakshmi Yadlapati authored
      
      
      The current call to getSubTreePaths is using a depth of 1, which limits
      the search to only the direct children of the inventoryPath. However,
      the interface may be found at any depth in the subtree, so the depth
      parameter should be set to 0 to search the entire subtree, in order to
      ensure that all relevant objects are included in the search results.
      
      getValidPCIeDevicePath and getPCIeDeviceList should call getSubTreePaths with the same depth parameter value to ensure that the same level of the PCIe device tree is being searched for devices.
      
      Tested: Validator passed
      
      Change-Id: Ic990581ef186f4bf1511a221c4e305ff6c2afdf2
      Signed-off-by: default avatarLakshmi Yadlapati <lakshmiy@us.ibm.com>
      38e3d67d
  6. May 02, 2023
  7. May 01, 2023
  8. Apr 28, 2023
  9. Apr 27, 2023
    • Ed Tanous's avatar
      Remove nameStr from router · 28f4b387
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      It isn't used anywhere in the code, so it can be removed, and the router
      simplified.  These common data structures have caused problems, in that
      they're not copied to child handlers, and cause bugs like #249.
      
      Tested: Redfish service validator passes.  Basic sanity tests of both
      static file routes such as $metadata (which use DynamicRule) as well as
      method routes, such as /redfish/v1, return valid data.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I93ad74581912e18ee5db9aaa9ecdaf08ed765418
      28f4b387
    • Ed Tanous's avatar
      Remove number support from the router · 15a42df0
      Ed Tanous authored and Ed Tanous's avatar Ed Tanous committed
      
      
      The router historically came from crow.  Crow supported wildcards of
      <int>, <float>, and <double>.  bmcweb doesn't use them, nor should it in
      basically any case, as we now have explicit 404 handling.
      
      This commit removes them.  This amounts to about -450 lines of code, but
      it's some of the scarier code we have, some of it existing in the
      namespace "black_magic".  Reducing the brain debt for people working in
      this subsystem seems worthwhile.  There is no case in the future where
      we would use integer based url parameters.
      
      Tested: Redfish service validator passes.  Should be good enough
      coverage for a code removal.
      
      Signed-off-by: default avatarEd Tanous <edtanous@google.com>
      Change-Id: I34add8df7d3486952474ca7ec3dc6be990c50ed0
      15a42df0
Loading