Hi all.

This patch auto rebuilds the SDRR from Sensor device SDRs if there is no SDR in 
the SDR repository.

I'm thinking of committing it to CVS, any objection?
I was thinking there might be a risk that some broken BMC might not like that. 
Do you know of any?

Index: lib/ipmi_sdr.c
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_sdr.c,v
retrieving revision 1.90
diff -u -r1.90 ipmi_sdr.c
--- lib/ipmi_sdr.c      5 Jun 2009 15:02:39 -0000       1.90
+++ lib/ipmi_sdr.c      9 Jun 2009 15:52:27 -0000
@@ -2656,6 +2656,14 @@

                lprintf(LOG_DEBUG, "SDR free space: %d", sdr_info.free);
                lprintf(LOG_DEBUG, "SDR records   : %d", sdr_info.count);
+               if( sdr_info.count == 0 ) {
+                  lprintf(LOG_DEBUG, "Rebuilding SDRR...");
+                  if( ipmi_sdr_add_from_sensors( intf, 0 ) != 0 ) {
+                     lprintf(LOG_ERR, "Could not build SDRR!");
+                     free(itr);
+                     return NULL;
+                  }
+               }
        } else {
                struct sdr_device_info_rs sdr_info;
                /* get device sdr info */

François Isabelle | Software Designer | Kontron Canada | T 450 437 5682 |F 450 
437 8053 | E francois.isabe...@ca.kontron.com


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to