[PATCH phosphor-host-ipmid v2] IPMI soft power off

Patrick Williams patrick at stwcx.xyz
Wed Nov 25 02:36:50 AEDT 2015


On Sat, Nov 21, 2015 at 01:10:24PM -0500, OpenBMC Patches wrote:
> From: vishwa <vishwanath at in.ibm.com>
> diff --git a/ipmid-api.h b/ipmid-api.h
> index 34d3bbe..952dd3f 100644
> --- a/ipmid-api.h
> +++ b/ipmid-api.h
> @@ -53,7 +53,7 @@ typedef ipmi_ret_t (*ipmid_callback_t)(ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t,
>  // information of netfn, cmd, callback handler pointer and context data.
>  // Making this a extern "C" so that plugin libraries written in C can also use
>  // it.
> -extern "C" void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t, 
> +extern "C" void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t,
>                                         ipmi_context_t, ipmid_callback_t);
>  
>  // These are the command network functions, the response
> @@ -94,5 +94,5 @@ enum ipmi_return_codes
>      IPMI_CC_UNSPECIFIED_ERROR = 0xFF,
>  };
>  
> -sd_bus *ipmid_get_sd_bus_connection(void);
> +extern "C" sd_bus* ipmid_get_sd_bus_connection(void);
>  #endif

These shouldn't just have 'extern "C"' otherwise we can't pull the
header file into C code because this isn't valid syntax (which defeats
the purpose of making the functions extern "C").

    #ifdef __cplusplus
    extern "C"
    #endif

> diff --git a/ipmid.C b/ipmid.C
> index 6b1eacc..440705c 100644
> --- a/ipmid.C
> +++ b/ipmid.C
> @@ -40,7 +40,6 @@ typedef std::pair<ipmid_callback_t, ipmi_context_t> ipmi_fn_context_t;
>  std::map<ipmi_fn_cmd_t, ipmi_fn_context_t> g_ipmid_router_map;
>  
>  
> -
>  #ifndef HEXDUMP_COLS
>  #define HEXDUMP_COLS 16
>  #endif
> @@ -418,6 +417,10 @@ int main(int argc, char *argv[])
>      // Register all the handlers that provider implementation to IPMI commands.
>      ipmi_register_callback_handlers(HOST_IPMI_LIB_PATH);
>  
> +	// Start the Host Services Dbus Objects
> +	start_host_service(bus, slot);
> +

I'm disappointed that we did not make this any sort of plugin
architecture.  We did all the work for the other ipmi messages, so it
seems odd to not do it for this.  Someone could remove the ipmi handler
for the host soft power-off, but now they cannot remove the dbus
handler.  The dbus handler is effectively an OEM implementation so at
some point we need to figure out how to move this into a plugin.

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20151124/85fc4b2f/attachment-0001.sig>


More information about the openbmc mailing list