openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
156 stars 131 forks source link

hypervisor routes are installed on systems that don't have hypervisors #180

Closed edtanous closed 1 year ago

edtanous commented 3 years ago

Since commit 462023addac00b521fc2e59ae53080046438ddfa the /redfish/v1/systems/hypervisor routes have been showing up in the systems collection for all systems. Considering the majority of systems don't have a hypervisor present, these nodes should not be showing up in the tree, and should be doing checks against dbus to see if a hypervisor is present before instantiating the nodes. https://github.com/openbmc/bmcweb/blob/1a2a14379d515c393cc134ea719d56efbae2116e/redfish-core/lib/systems.hpp#L1892b

The sub nodes, should also return 404 properly when a hypervisor isn't present. Today they seem to return internal error (500).

edtanous commented 3 years ago

@sunharis Looks like you're the author on the commit in question Can you take a look at and resolve this?

sunharis commented 3 years ago

The dbus call is made against the path "/xyz/openbmc_project/network/hypervisor". A Get query on the hypervisors "HostName" parameter is performed. https://github.com/openbmc/bmcweb/blob/1a2a14379d515c393cc134ea719d56efbae2116e/redfish-core/lib/systems.hpp#L1897

Is this path available on systems - where there is no hypervisor ?

jiaqingz-intel commented 2 years ago

Submitted a patch for this https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/52777

My opinion is the hypervisor-related code should only be built for IBM-systems.

edtanous commented 1 year ago

This has been resolved by merging the hypervisor and ComputerSystem routes.