os-cmpi-xen

changeset 17:1faa76de765e

Changes to several files to satisfy the SuSE autobuild process, e.g. cleaned up warnings, buffer overflows, etc.
Also changed the name of project from sblim-cmpi-xen to xen-cim-cmpi.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author jfehlig@jfehlig3.provo.novell.com
date Tue Aug 15 17:58:31 2006 -0600 (2006-08-15)
parents 94fc22b52c5d
children 8485e8704003
files Makefile.am configure.ac sblim-cmpi-xen.spec.in src/Makefile.am src/Xen_CSElementSettingData.c src/Xen_CSSettingDataComponent.c src/Xen_ComputerSystem.c src/Xen_ComputerSystemDisk.c src/Xen_ComputerSystemIndication.c src/Xen_ComputerSystemMemory.c src/Xen_ComputerSystemNetworkPort.c src/Xen_ComputerSystemProcessor.c src/Xen_DiskElementSettingData.c src/Xen_Disk_Resource.c src/Xen_HasVirtualizationCapabilities.c src/Xen_HostedComputerSystem.c src/Xen_HostedDisk.c src/Xen_HostedMemory.c src/Xen_HostedMemoryPool.c src/Xen_HostedNetworkPort.c src/Xen_HostedProcessor.c src/Xen_HostedProcessorPool.c src/Xen_HostedVirtualSystemManagementService.c src/Xen_MemoryCapabilitiesSettingData_Resource.c src/Xen_MemoryElementSettingData.c src/Xen_MemoryPool_Resource.c src/Xen_NetworkPortElementSettingData.c src/Xen_OperatingSystem.c src/Xen_ProcessorAllocatedFromPool.c src/Xen_ProcessorCapabilitiesSettingData_Resource.c src/Xen_ProcessorElementSettingData.c src/Xen_ProcessorPool_Resource.c src/Xen_ProcessorSettingAllocationFromPool.c src/Xen_RunningOS.c src/Xen_SettingDataLexer.l src/Xen_VirtualSystemManagementService_Resource.c src/Xen_VirtualizationCapabilities_Resource.c src/cmpiutil.c src/xm.c xen-cim-cmpi.spec.in
line diff
     1.1 --- a/Makefile.am	Fri Jul 28 12:10:17 2006 -0600
     1.2 +++ b/Makefile.am	Tue Aug 15 17:58:31 2006 -0600
     1.3 @@ -21,6 +21,8 @@
     1.4  #    Automake input file for the CMPI Xen CIM provider.
     1.5  # =============================================================================
     1.6  
     1.7 +AUTOMAKE_OPTIONS=dist-bzip2
     1.8 +
     1.9  # Start with an empty extra distribution file list
    1.10  EXTRA_DIST=
    1.11  
    1.12 @@ -38,7 +40,7 @@ dist-hook:
    1.13  
    1.14  # MAKE CHANGES HERE TO INSTALL THE DOCUMENTATION FILES FOR YOUR PROVIDER
    1.15  # docdir specifies where the documentation will be installed
    1.16 -docdir=$(datadir)/doc/$(PACKAGE)-$(VERSION)
    1.17 +docdir=$(datadir)/doc/packages/$(PACKAGE)
    1.18  
    1.19  # Add standard package doc files
    1.20  doc_DATA=README AUTHORS COPYING
    1.21 @@ -169,5 +171,5 @@ EXTRA_DIST+=schema $(pkgdata_DATA) $(pkg
    1.22  # Automake instructions to generate source tarball for cmpi-xen
    1.23  # -----------------------------------------------------------------------------
    1.24  
    1.25 -dist:
    1.26 -	sh make-srcpkg.sh
    1.27 +#dist:
    1.28 +#	sh make-srcpkg.sh
     2.1 --- a/configure.ac	Fri Jul 28 12:10:17 2006 -0600
     2.2 +++ b/configure.ac	Tue Aug 15 17:58:31 2006 -0600
     2.3 @@ -33,7 +33,7 @@
     2.4  # Package information
     2.5  # CHANGE THIS TO THE PACKAGE SUMMARY INFORMATION
     2.6  # AC_INIT(<PACKAGE_NAME>, <PACKAGE_VERSION>, <PACKAGE_BUGREPORT>, <PACKAGE_TARBALL>)
     2.7 -AC_INIT(CMPI Xen Provider, 0.1.0, bestor@us.ibm.com, sblim-cmpi-xen)
     2.8 +AC_INIT(CMPI Xen Provider, 0.1.0, bestor@us.ibm.com, xen-cim-cmpi)
     2.9  
    2.10  # Identify the source directory 
    2.11  # CHANGE THIS TO THE RELATIVE PATHNAME OF *ONE* OF THE SOURCE FILES
    2.12 @@ -41,7 +41,7 @@ AC_CONFIG_SRCDIR([src/Xen_ComputerSystem
    2.13  
    2.14  # Create any necessary files from "<file>.in" templates
    2.15  # CHANGE THIS TO THE NAME OF THE PACKAGE RPM SPEC FILE. E.G. "<PACKAGE_TARBALL>.spec"
    2.16 -AC_CONFIG_FILES([sblim-cmpi-xen.spec])
    2.17 +AC_CONFIG_FILES([xen-cim-cmpi.spec])
    2.18  
    2.19  # Check for required programs, such as commands used in system() calls or
    2.20  # any special tools required for building this package (e.g. lex, yacc, etc)
     3.1 --- a/sblim-cmpi-xen.spec.in	Fri Jul 28 12:10:17 2006 -0600
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,111 +0,0 @@
     3.4 -# $Id:
     3.5 -# =============================================================================
     3.6 -# (C) Copyright IBM Corp. 2006
     3.7 -#
     3.8 -#    This library is free software; you can redistribute it and/or
     3.9 -#    modify it under the terms of the GNU Lesser General Public
    3.10 -#    License as published by the Free Software Foundation; either
    3.11 -#    version 2.1 of the License, or (at your option) any later version.
    3.12 -#
    3.13 -#    This library is distributed in the hope that it will be useful,
    3.14 -#    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 -#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 -#    Lesser General Public License for more details.
    3.17 -#
    3.18 -#    You should have received a copy of the GNU Lesser General Public
    3.19 -#    License along with this library; if not, write to the Free Software
    3.20 -#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3.21 -# =============================================================================
    3.22 -# Author:       Dr. Gareth S. Bestor <bestor@us.ibm.com>
    3.23 -# Contributors:
    3.24 -# Description:
    3.25 -#    RPM spec file for the CMPI Xen provider.
    3.26 -# =============================================================================
    3.27 -
    3.28 -Summary: CMPI Xen provider
    3.29 -Name: @PACKAGE_TARNAME@
    3.30 -Version: @PACKAGE_VERSION@
    3.31 -Release: @CIMSERVER@
    3.32 -Group: Systems Management/Base
    3.33 -License: GNU Lesser General Public Version 2.1
    3.34 -Requires: cimserver
    3.35 -
    3.36 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
    3.37 -BuildRequires: cmpi-devel
    3.38 -Source0: http://prdownloads.sourceforge.net/sblim/%{name}-%{version}.tar.bz2
    3.39 -
    3.40 -# -----------------------------------------------------------------------------
    3.41 -
    3.42 -%Description
    3.43 -TODO
    3.44 -
    3.45 -# -----------------------------------------------------------------------------
    3.46 -
    3.47 -%prep
    3.48 -%setup -n %{name}-%{version}
    3.49 -
    3.50 -export PATCH_GET=0
    3.51 -#%patch0 -p0
    3.52 -
    3.53 -# -----------------------------------------------------------------------------
    3.54 -
    3.55 -%build
    3.56 -%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite CIMSERVER=@CIMSERVER@
    3.57 -make
    3.58 -
    3.59 -# -----------------------------------------------------------------------------
    3.60 -                                                                                                                
    3.61 -%clean
    3.62 -# paranoia check
    3.63 -if [ `id -ur` != 0 ]
    3.64 -then
    3.65 -   rm -rf $RPM_BUILD_ROOT
    3.66 -fi
    3.67 -
    3.68 -# -----------------------------------------------------------------------------
    3.69 -
    3.70 -%install
    3.71 -# paranoia check
    3.72 -if [ `id -ur` != 0 ]
    3.73 -then
    3.74 -   rm -rf $RPM_BUILD_ROOT 
    3.75 -fi
    3.76 -
    3.77 -make DESTDIR=$RPM_BUILD_ROOT install
    3.78 -
    3.79 -# Remove unused libtool files
    3.80 -rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a
    3.81 -
    3.82 -# -----------------------------------------------------------------------------
    3.83 -
    3.84 -%post
    3.85 -
    3.86 -# LIST PROVIDER CLASS SCHEMA AND REGISTRATION FILES HERE
    3.87 -%define SCHEMA %{_datadir}/%{name}/Xen_ComputerSystem.mof
    3.88 -%define REGISTRATION %{_datadir}/%{name}/Xen_ComputerSystem.registration
    3.89 -
    3.90 -# Register Schema and Provider
    3.91 -%{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \
    3.92 -        -r %{REGISTRATION} -m %{SCHEMA} > /dev/null
    3.93 -
    3.94 -/sbin/ldconfig
    3.95 -
    3.96 -# -----------------------------------------------------------------------------
    3.97 -                                                                                
    3.98 -%preun
    3.99 -
   3.100 -# De-Register Schema and Provider
   3.101 -%{_datadir}/%{name}/provider-register.sh -d -t @CIMSERVER@ \
   3.102 -        -r %{REGISTRATION} -m %{SCHEMA} > /dev/null
   3.103 -                                                                                
   3.104 -%postun
   3.105 -/sbin/ldconfig
   3.106 -                                                                                
   3.107 -# -----------------------------------------------------------------------------
   3.108 -
   3.109 -%files
   3.110 -%defattr(-,root,root)
   3.111 -%{_datadir}/%{name}
   3.112 -%{_datadir}/doc/%{name}-%{version}
   3.113 -%{_libdir}/cmpi/*.so*
   3.114 -
     4.1 --- a/src/Makefile.am	Fri Jul 28 12:10:17 2006 -0600
     4.2 +++ b/src/Makefile.am	Tue Aug 15 17:58:31 2006 -0600
     4.3 @@ -24,6 +24,9 @@
     4.4  # Start with an empty extra distribution file list
     4.5  EXTRA_DIST=
     4.6  
     4.7 +# Add lex and yacc files to distribution
     4.8 +EXTRA_DIST+=Xen_SettingDataLexer.l Xen_SettingDataParser.y Xen_SettingDataParser.h 
     4.9 +
    4.10  
    4.11  # -----------------------------------------------------------------------------
    4.12  # Automake instructions for source 
    4.13 @@ -259,6 +262,3 @@ Xen_SettingDataLexer.c: Xen_SettingDataL
    4.14  
    4.15  Xen_SettingDataParser.c: Xen_SettingDataLexer.l Xen_SettingDataParser.y
    4.16  	yacc -p Xen_SettingDatayy -d -o Xen_SettingDataParser.c Xen_SettingDataParser.y
    4.17 -
    4.18 -
    4.19 -
     5.1 --- a/src/Xen_CSElementSettingData.c	Fri Jul 28 12:10:17 2006 -0600
     5.2 +++ b/src/Xen_CSElementSettingData.c	Tue Aug 15 17:58:31 2006 -0600
     5.3 @@ -19,6 +19,8 @@
     5.4  // Description:
     5.5  // ============================================================================
     5.6  
     5.7 +#include <string.h>
     5.8 +
     5.9  /* Include the required CMPI data types, function headers, and macros */
    5.10  #include "cmpidt.h"
    5.11  #include "cmpift.h"
     6.1 --- a/src/Xen_CSSettingDataComponent.c	Fri Jul 28 12:10:17 2006 -0600
     6.2 +++ b/src/Xen_CSSettingDataComponent.c	Tue Aug 15 17:58:31 2006 -0600
     6.3 @@ -19,6 +19,8 @@
     6.4  // Description:
     6.5  // ============================================================================
     6.6  
     6.7 +#include <string.h>
     6.8 +
     6.9  /* Include the required CMPI data types, function headers, and macros */
    6.10  #include "cmpidt.h"
    6.11  #include "cmpift.h"
     7.1 --- a/src/Xen_ComputerSystem.c	Fri Jul 28 12:10:17 2006 -0600
     7.2 +++ b/src/Xen_ComputerSystem.c	Tue Aug 15 17:58:31 2006 -0600
     7.3 @@ -20,6 +20,8 @@
     7.4  // Description:
     7.5  // ============================================================================
     7.6  
     7.7 +#include <string.h>
     7.8 +
     7.9  #include "provider_common.h"
    7.10  
    7.11  /* Include the required CMPI data types, function headers, and macros */
     8.1 --- a/src/Xen_ComputerSystemDisk.c	Fri Jul 28 12:10:17 2006 -0600
     8.2 +++ b/src/Xen_ComputerSystemDisk.c	Tue Aug 15 17:58:31 2006 -0600
     8.3 @@ -19,6 +19,8 @@
     8.4  // Description:
     8.5  // ============================================================================
     8.6  
     8.7 +#include <string.h>
     8.8 +
     8.9  /* Include the required CMPI data types, function headers, and macros */
    8.10  #include "cmpidt.h"
    8.11  #include "cmpift.h"
     9.1 --- a/src/Xen_ComputerSystemIndication.c	Fri Jul 28 12:10:17 2006 -0600
     9.2 +++ b/src/Xen_ComputerSystemIndication.c	Tue Aug 15 17:58:31 2006 -0600
     9.3 @@ -19,6 +19,8 @@
     9.4  // Description:
     9.5  // ============================================================================
     9.6  
     9.7 +#include <string.h>
     9.8 +
     9.9  /* Include the required CMPI data types, function headers, and macros */
    9.10  #include "cmpidt.h"
    9.11  #include "cmpift.h"
    10.1 --- a/src/Xen_ComputerSystemMemory.c	Fri Jul 28 12:10:17 2006 -0600
    10.2 +++ b/src/Xen_ComputerSystemMemory.c	Tue Aug 15 17:58:31 2006 -0600
    10.3 @@ -19,6 +19,8 @@
    10.4  // Description:
    10.5  // ============================================================================
    10.6  
    10.7 +#include <string.h>
    10.8 +
    10.9  /* Include the required CMPI data types, function headers, and macros */
   10.10  #include "cmpidt.h"
   10.11  #include "cmpift.h"
    11.1 --- a/src/Xen_ComputerSystemNetworkPort.c	Fri Jul 28 12:10:17 2006 -0600
    11.2 +++ b/src/Xen_ComputerSystemNetworkPort.c	Tue Aug 15 17:58:31 2006 -0600
    11.3 @@ -19,6 +19,8 @@
    11.4  // Description:
    11.5  // ============================================================================
    11.6  
    11.7 +#include <string.h>
    11.8 +
    11.9  /* Include the required CMPI data types, function headers, and macros */
   11.10  #include "cmpidt.h"
   11.11  #include "cmpift.h"
    12.1 --- a/src/Xen_ComputerSystemProcessor.c	Fri Jul 28 12:10:17 2006 -0600
    12.2 +++ b/src/Xen_ComputerSystemProcessor.c	Tue Aug 15 17:58:31 2006 -0600
    12.3 @@ -19,6 +19,8 @@
    12.4  // Description:
    12.5  // ============================================================================
    12.6  
    12.7 +#include <string.h>
    12.8 +
    12.9  /* Include the required CMPI data types, function headers, and macros */
   12.10  #include "cmpidt.h"
   12.11  #include "cmpift.h"
    13.1 --- a/src/Xen_DiskElementSettingData.c	Fri Jul 28 12:10:17 2006 -0600
    13.2 +++ b/src/Xen_DiskElementSettingData.c	Tue Aug 15 17:58:31 2006 -0600
    13.3 @@ -19,6 +19,8 @@
    13.4  // Description:
    13.5  // ============================================================================
    13.6  
    13.7 +#include <string.h>
    13.8 +
    13.9  /* Include the required CMPI data types, function headers, and macros */
   13.10  #include "cmpidt.h"
   13.11  #include "cmpift.h"
    14.1 --- a/src/Xen_Disk_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    14.2 +++ b/src/Xen_Disk_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    14.3 @@ -20,6 +20,7 @@
    14.4  // Description:
    14.5  // ============================================================================
    14.6  
    14.7 +#include <string.h>
    14.8  #include <stdlib.h>
    14.9  
   14.10  #include "Xen_Disk_Resource.h"
    15.1 --- a/src/Xen_HasVirtualizationCapabilities.c	Fri Jul 28 12:10:17 2006 -0600
    15.2 +++ b/src/Xen_HasVirtualizationCapabilities.c	Tue Aug 15 17:58:31 2006 -0600
    15.3 @@ -19,6 +19,8 @@
    15.4  // Description:
    15.5  // ============================================================================
    15.6  
    15.7 +#include <string.h>
    15.8 +
    15.9  /* Include the required CMPI data types, function headers, and macros */
   15.10  #include "cmpidt.h"
   15.11  #include "cmpift.h"
    16.1 --- a/src/Xen_HostedComputerSystem.c	Fri Jul 28 12:10:17 2006 -0600
    16.2 +++ b/src/Xen_HostedComputerSystem.c	Tue Aug 15 17:58:31 2006 -0600
    16.3 @@ -20,6 +20,8 @@
    16.4  // Description:
    16.5  // ============================================================================
    16.6  
    16.7 +#include <string.h>
    16.8 +
    16.9  /* Include the required CMPI data types, function headers, and macros */
   16.10  #include "cmpidt.h"
   16.11  #include "cmpift.h"
    17.1 --- a/src/Xen_HostedDisk.c	Fri Jul 28 12:10:17 2006 -0600
    17.2 +++ b/src/Xen_HostedDisk.c	Tue Aug 15 17:58:31 2006 -0600
    17.3 @@ -20,6 +20,8 @@
    17.4  // Description:
    17.5  // ============================================================================
    17.6  
    17.7 +#include <string.h>
    17.8 +
    17.9  /* Include the required CMPI data types, function headers, and macros */
   17.10  #include "cmpidt.h"
   17.11  #include "cmpift.h"
    18.1 --- a/src/Xen_HostedMemory.c	Fri Jul 28 12:10:17 2006 -0600
    18.2 +++ b/src/Xen_HostedMemory.c	Tue Aug 15 17:58:31 2006 -0600
    18.3 @@ -20,6 +20,8 @@
    18.4  // Description:
    18.5  // ============================================================================
    18.6  
    18.7 +#include <string.h>
    18.8 +
    18.9  /* Include the required CMPI data types, function headers, and macros */
   18.10  #include "cmpidt.h"
   18.11  #include "cmpift.h"
    19.1 --- a/src/Xen_HostedMemoryPool.c	Fri Jul 28 12:10:17 2006 -0600
    19.2 +++ b/src/Xen_HostedMemoryPool.c	Tue Aug 15 17:58:31 2006 -0600
    19.3 @@ -19,6 +19,8 @@
    19.4  // Description:
    19.5  // ============================================================================
    19.6  
    19.7 +#include <string.h>
    19.8 +
    19.9  /* Include the required CMPI data types, function headers, and macros */
   19.10  #include "cmpidt.h"
   19.11  #include "cmpift.h"
    20.1 --- a/src/Xen_HostedNetworkPort.c	Fri Jul 28 12:10:17 2006 -0600
    20.2 +++ b/src/Xen_HostedNetworkPort.c	Tue Aug 15 17:58:31 2006 -0600
    20.3 @@ -20,6 +20,8 @@
    20.4  // Description:
    20.5  // ============================================================================
    20.6  
    20.7 +#include <string.h>
    20.8 +
    20.9  /* Include the required CMPI data types, function headers, and macros */
   20.10  #include "cmpidt.h"
   20.11  #include "cmpift.h"
    21.1 --- a/src/Xen_HostedProcessor.c	Fri Jul 28 12:10:17 2006 -0600
    21.2 +++ b/src/Xen_HostedProcessor.c	Tue Aug 15 17:58:31 2006 -0600
    21.3 @@ -20,6 +20,8 @@
    21.4  // Description:
    21.5  // ============================================================================
    21.6  
    21.7 +#include <string.h>
    21.8 +
    21.9  /* Include the required CMPI data types, function headers, and macros */
   21.10  #include "cmpidt.h"
   21.11  #include "cmpift.h"
    22.1 --- a/src/Xen_HostedProcessorPool.c	Fri Jul 28 12:10:17 2006 -0600
    22.2 +++ b/src/Xen_HostedProcessorPool.c	Tue Aug 15 17:58:31 2006 -0600
    22.3 @@ -19,6 +19,8 @@
    22.4  // Description:
    22.5  // ============================================================================
    22.6  
    22.7 +#include <string.h>
    22.8 +
    22.9  /* Include the required CMPI data types, function headers, and macros */
   22.10  #include "cmpidt.h"
   22.11  #include "cmpift.h"
    23.1 --- a/src/Xen_HostedVirtualSystemManagementService.c	Fri Jul 28 12:10:17 2006 -0600
    23.2 +++ b/src/Xen_HostedVirtualSystemManagementService.c	Tue Aug 15 17:58:31 2006 -0600
    23.3 @@ -19,6 +19,8 @@
    23.4  // Description:
    23.5  // ============================================================================
    23.6  
    23.7 +#include <string.h>
    23.8 +
    23.9  /* Include the required CMPI data types, function headers, and macros */
   23.10  #include "cmpidt.h"
   23.11  #include "cmpift.h"
    24.1 --- a/src/Xen_MemoryCapabilitiesSettingData_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    24.2 +++ b/src/Xen_MemoryCapabilitiesSettingData_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    24.3 @@ -19,6 +19,8 @@
    24.4  // Description:
    24.5  // ============================================================================
    24.6  
    24.7 +#include <string.h>
    24.8 +
    24.9  #include "Xen_MemoryCapabilitiesSettingData_Resource.h"
   24.10  
   24.11  /* Include the required CMPI data types, function headers, and macros. */
    25.1 --- a/src/Xen_MemoryElementSettingData.c	Fri Jul 28 12:10:17 2006 -0600
    25.2 +++ b/src/Xen_MemoryElementSettingData.c	Tue Aug 15 17:58:31 2006 -0600
    25.3 @@ -19,6 +19,8 @@
    25.4  // Description:
    25.5  // ============================================================================
    25.6  
    25.7 +#include <string.h>
    25.8 +
    25.9  /* Include the required CMPI data types, function headers, and macros */
   25.10  #include "cmpidt.h"
   25.11  #include "cmpift.h"
    26.1 --- a/src/Xen_MemoryPool_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    26.2 +++ b/src/Xen_MemoryPool_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    26.3 @@ -19,6 +19,9 @@
    26.4  // Description:
    26.5  // ============================================================================
    26.6  
    26.7 +#include <string.h>
    26.8 +#include <unistd.h>
    26.9 +
   26.10  #include "Xen_MemoryPool_Resource.h"
   26.11  
   26.12  /* Include the required CMPI data types, function headers, and macros. */
    27.1 --- a/src/Xen_NetworkPortElementSettingData.c	Fri Jul 28 12:10:17 2006 -0600
    27.2 +++ b/src/Xen_NetworkPortElementSettingData.c	Tue Aug 15 17:58:31 2006 -0600
    27.3 @@ -19,6 +19,8 @@
    27.4  // Description:
    27.5  // ============================================================================
    27.6  
    27.7 +#include <string.h>
    27.8 +
    27.9  /* Include the required CMPI data types, function headers, and macros */
   27.10  #include "cmpidt.h"
   27.11  #include "cmpift.h"
    28.1 --- a/src/Xen_OperatingSystem.c	Fri Jul 28 12:10:17 2006 -0600
    28.2 +++ b/src/Xen_OperatingSystem.c	Tue Aug 15 17:58:31 2006 -0600
    28.3 @@ -19,6 +19,8 @@
    28.4  // Description:
    28.5  // ============================================================================
    28.6  
    28.7 +#include <string.h>
    28.8 +
    28.9  /* Include the required CMPI data types, function headers, and macros */
   28.10  #include "cmpidt.h"
   28.11  #include "cmpift.h"
    29.1 --- a/src/Xen_ProcessorAllocatedFromPool.c	Fri Jul 28 12:10:17 2006 -0600
    29.2 +++ b/src/Xen_ProcessorAllocatedFromPool.c	Tue Aug 15 17:58:31 2006 -0600
    29.3 @@ -19,6 +19,8 @@
    29.4  // Description:
    29.5  // ============================================================================
    29.6  
    29.7 +#include <string.h>
    29.8 +
    29.9  /* Include the required CMPI data types, function headers, and macros */
   29.10  #include "cmpidt.h"
   29.11  #include "cmpift.h"
    30.1 --- a/src/Xen_ProcessorCapabilitiesSettingData_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    30.2 +++ b/src/Xen_ProcessorCapabilitiesSettingData_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    30.3 @@ -19,6 +19,8 @@
    30.4  // Description:
    30.5  // ============================================================================
    30.6  
    30.7 +#include <string.h>
    30.8 +
    30.9  #include "Xen_ProcessorCapabilitiesSettingData_Resource.h"
   30.10  
   30.11  /* Include the required CMPI data types, function headers, and macros. */
    31.1 --- a/src/Xen_ProcessorElementSettingData.c	Fri Jul 28 12:10:17 2006 -0600
    31.2 +++ b/src/Xen_ProcessorElementSettingData.c	Tue Aug 15 17:58:31 2006 -0600
    31.3 @@ -19,6 +19,8 @@
    31.4  // Description:
    31.5  // ============================================================================
    31.6  
    31.7 +#include <string.h>
    31.8 +
    31.9  /* Include the required CMPI data types, function headers, and macros */
   31.10  #include "cmpidt.h"
   31.11  #include "cmpift.h"
    32.1 --- a/src/Xen_ProcessorPool_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    32.2 +++ b/src/Xen_ProcessorPool_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    32.3 @@ -19,6 +19,8 @@
    32.4  // Description:
    32.5  // ============================================================================
    32.6  
    32.7 +#include <string.h>
    32.8 +
    32.9  #include "Xen_ProcessorPool_Resource.h"
   32.10  
   32.11  /* Include the required CMPI data types, function headers, and macros. */
    33.1 --- a/src/Xen_ProcessorSettingAllocationFromPool.c	Fri Jul 28 12:10:17 2006 -0600
    33.2 +++ b/src/Xen_ProcessorSettingAllocationFromPool.c	Tue Aug 15 17:58:31 2006 -0600
    33.3 @@ -19,6 +19,8 @@
    33.4  // Description:
    33.5  // ============================================================================
    33.6  
    33.7 +#include <string.h>
    33.8 +
    33.9  /* Include the required CMPI data types, function headers, and macros */
   33.10  #include "cmpidt.h"
   33.11  #include "cmpift.h"
    34.1 --- a/src/Xen_RunningOS.c	Fri Jul 28 12:10:17 2006 -0600
    34.2 +++ b/src/Xen_RunningOS.c	Tue Aug 15 17:58:31 2006 -0600
    34.3 @@ -19,6 +19,8 @@
    34.4  // Description:
    34.5  // ============================================================================
    34.6  
    34.7 +#include <string.h>
    34.8 +
    34.9  /* Include the required CMPI data types, function headers, and macros */
   34.10  #include "cmpidt.h"
   34.11  #include "cmpift.h"
    35.1 --- a/src/Xen_SettingDataLexer.l	Fri Jul 28 12:10:17 2006 -0600
    35.2 +++ b/src/Xen_SettingDataLexer.l	Tue Aug 15 17:58:31 2006 -0600
    35.3 @@ -122,7 +122,7 @@ FALSE	{
    35.4  	/* USER SUBROUTINE SECTION */
    35.5  	/* Everything below is copied verbatim to the end of the lex generated C code. */
    35.6  
    35.7 -yyerror(char *errmsg)
    35.8 +void yyerror(char *errmsg)
    35.9  {
   35.10     fprintf(stderr, "error line %d: %s in '%s'\n", yylineno, errmsg, yytext);
   35.11  }
    36.1 --- a/src/Xen_VirtualSystemManagementService_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    36.2 +++ b/src/Xen_VirtualSystemManagementService_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    36.3 @@ -19,6 +19,9 @@
    36.4  // Description:
    36.5  // ============================================================================
    36.6  
    36.7 +#include <string.h>
    36.8 +#include <unistd.h>
    36.9 +
   36.10  #include "Xen_VirtualSystemManagementService_Resource.h"
   36.11  
   36.12  /* Include the required CMPI data types, function headers, and macros. */
    37.1 --- a/src/Xen_VirtualizationCapabilities_Resource.c	Fri Jul 28 12:10:17 2006 -0600
    37.2 +++ b/src/Xen_VirtualizationCapabilities_Resource.c	Tue Aug 15 17:58:31 2006 -0600
    37.3 @@ -19,6 +19,8 @@
    37.4  // Description:
    37.5  // ============================================================================
    37.6  
    37.7 +#include <string.h>
    37.8 +
    37.9  #include "Xen_VirtualizationCapabilities_Resource.h"
   37.10  
   37.11  /* Include the required CMPI data types, function headers, and macros. */
    38.1 --- a/src/cmpiutil.c	Fri Jul 28 12:10:17 2006 -0600
    38.2 +++ b/src/cmpiutil.c	Tue Aug 15 17:58:31 2006 -0600
    38.3 @@ -271,55 +271,74 @@ const char * _CMPITypeName ( CMPIType ty
    38.4  char * _CMPIValueToString ( CMPIData data )
    38.5  {
    38.6     char * valuestring = NULL;
    38.7 -
    38.8 +   int len;
    38.9 +   
   38.10     /* First make sure there is a value. */
   38.11     if (CMIsNullValue(data)) return NULL;
   38.12  
   38.13     /* Format the value string as appropriate for the value type. */
   38.14     switch(data.type) {
   38.15        case CMPI_char16: {
   38.16 -         valuestring = (char *)malloc(2*sizeof(char));
   38.17 -         snprintf(valuestring, sizeof(valuestring), "%c", data.value.char16);
   38.18 +         len = 2 * sizeof(char);
   38.19 +         valuestring = (char *)malloc(len);
   38.20 +         if (valuestring == NULL) return NULL;
   38.21 +         snprintf(valuestring, len, "%c", data.value.char16);
   38.22           return valuestring;
   38.23        }
   38.24        case CMPI_sint8: {
   38.25 -         valuestring = (char *)malloc(5*sizeof(char));
   38.26 -         snprintf(valuestring, sizeof(valuestring), "%d", data.value.sint8);
   38.27 +         len = 5 * sizeof(char);
   38.28 +         valuestring = (char *)malloc(len);
   38.29 +         if (valuestring == NULL) return NULL;
   38.30 +         snprintf(valuestring, len, "%d", data.value.sint8);
   38.31           return valuestring;
   38.32        }
   38.33        case CMPI_uint8: {
   38.34 -         valuestring = (char *)malloc(4*sizeof(char));
   38.35 -         snprintf(valuestring, sizeof(valuestring), "%u", data.value.uint8);
   38.36 +         len = 4 * sizeof(char);
   38.37 +         valuestring = (char *)malloc(len);
   38.38 +         if (valuestring == NULL) return NULL;
   38.39 +         snprintf(valuestring, len, "%u", data.value.uint8);
   38.40           return valuestring;
   38.41        }
   38.42        case CMPI_sint16: {
   38.43 -         valuestring = (char *)malloc(7*sizeof(char));
   38.44 -         snprintf(valuestring, sizeof(valuestring), "%d", data.value.sint16);
   38.45 +         len = 7 * sizeof(char);
   38.46 +         valuestring = (char *)malloc(len);
   38.47 +         if (valuestring == NULL) return NULL;
   38.48 +         snprintf(valuestring, len, "%d", data.value.sint16);
   38.49           return valuestring;
   38.50        }
   38.51        case CMPI_uint16: {
   38.52 -         valuestring = (char *)malloc(6*sizeof(char));
   38.53 -         snprintf(valuestring, sizeof(valuestring), "%u", data.value.uint16);
   38.54 +         len = 6 * sizeof(char);
   38.55 +         valuestring = (char *)malloc(len);
   38.56 +         if (valuestring == NULL) return NULL;
   38.57 +         snprintf(valuestring, len, "%u", data.value.uint16);
   38.58           return valuestring;
   38.59        }
   38.60        case CMPI_sint32: {
   38.61 -         valuestring = (char *)malloc(12*sizeof(char));
   38.62 -         snprintf(valuestring, sizeof(valuestring), "%d", data.value.sint32);
   38.63 +         len = 12 * sizeof(char);
   38.64 +         valuestring = (char *)malloc(len);
   38.65 +         if (valuestring == NULL) return NULL;
   38.66 +         snprintf(valuestring, len, "%d", data.value.sint32);
   38.67           return valuestring;
   38.68        }
   38.69        case CMPI_uint32: {
   38.70 -         valuestring = (char *)malloc(11*sizeof(char));
   38.71 -         snprintf(valuestring, sizeof(valuestring), "%u", data.value.uint32);
   38.72 +         len = 11 * sizeof(char);
   38.73 +         valuestring = (char *)malloc(len);
   38.74 +         if (valuestring == NULL) return NULL;
   38.75 +         snprintf(valuestring, len, "%u", data.value.uint32);
   38.76           return valuestring;
   38.77        }
   38.78        case CMPI_sint64: {
   38.79 -         valuestring = (char *)malloc(21*sizeof(char));
   38.80 -         snprintf(valuestring, sizeof(valuestring), "%d", data.value.sint64);
   38.81 +         len = 21 * sizeof(char);
   38.82 +         valuestring = (char *)malloc(len);
   38.83 +         if (valuestring == NULL) return NULL;
   38.84 +         snprintf(valuestring, len, "%d", data.value.sint64);
   38.85           return valuestring;
   38.86        }
   38.87        case CMPI_uint64: {
   38.88 -         valuestring = (char *)malloc(20*sizeof(char));
   38.89 -         snprintf(valuestring, sizeof(valuestring), "%u", data.value.uint64);
   38.90 +         len = 20 * sizeof(char);
   38.91 +         valuestring = (char *)malloc(len);
   38.92 +         if (valuestring == NULL) return NULL;
   38.93 +         snprintf(valuestring, len, "%u", data.value.uint64);
   38.94           return valuestring;
   38.95        }
   38.96        case CMPI_string: {
   38.97 @@ -330,18 +349,24 @@ char * _CMPIValueToString ( CMPIData dat
   38.98           return valuestring;
   38.99        }
  38.100        case CMPI_boolean: {
  38.101 -         valuestring = (char *)malloc(6*sizeof(char));
  38.102 -         snprintf(valuestring, sizeof(valuestring), "%s", (data.value.boolean)? "TRUE":"FALSE");
  38.103 +         len = 6 * sizeof(char);
  38.104 +         valuestring = (char *)malloc(len);
  38.105 +         if (valuestring == NULL) return NULL;
  38.106 +         snprintf(valuestring, len, "%s", (data.value.boolean)? "TRUE":"FALSE");
  38.107           return valuestring;
  38.108        }
  38.109        case CMPI_real32: {
  38.110 -         valuestring = (char *)malloc(20*sizeof(char));
  38.111 -         snprintf(valuestring, sizeof(valuestring), "%.16e", data.value.real32);
  38.112 +         len = 20 * sizeof(char);
  38.113 +         valuestring = (char *)malloc(len);
  38.114 +         if (valuestring == NULL) return NULL;
  38.115 +         snprintf(valuestring, len, "%.16e", data.value.real32);
  38.116           return valuestring;
  38.117        }
  38.118        case CMPI_real64: {
  38.119 -         valuestring = (char *)malloc(36*sizeof(char));
  38.120 -         snprintf(valuestring, sizeof(valuestring), "%.32e", data.value.real64);
  38.121 +         len = 36 * sizeof(char);
  38.122 +         valuestring = (char *)malloc(len);
  38.123 +         if (valuestring == NULL) return NULL;
  38.124 +         snprintf(valuestring, len, "%.32e", data.value.real64);
  38.125           return valuestring;
  38.126        }
  38.127        case CMPI_dateTime: {
    39.1 --- a/src/xm.c	Fri Jul 28 12:10:17 2006 -0600
    39.2 +++ b/src/xm.c	Tue Aug 15 17:58:31 2006 -0600
    39.3 @@ -300,6 +300,7 @@ vbdxml2config(xmlNodePtr node, struct xm
    39.4            config->n_vbd++;
    39.5         }
    39.6      }
    39.7 +    return (0);
    39.8  }
    39.9  
   39.10  
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/xen-cim-cmpi.spec.in	Tue Aug 15 17:58:31 2006 -0600
    40.3 @@ -0,0 +1,111 @@
    40.4 +# $Id:
    40.5 +# =============================================================================
    40.6 +# (C) Copyright IBM Corp. 2006
    40.7 +#
    40.8 +#    This library is free software; you can redistribute it and/or
    40.9 +#    modify it under the terms of the GNU Lesser General Public
   40.10 +#    License as published by the Free Software Foundation; either
   40.11 +#    version 2.1 of the License, or (at your option) any later version.
   40.12 +#
   40.13 +#    This library is distributed in the hope that it will be useful,
   40.14 +#    but WITHOUT ANY WARRANTY; without even the implied warranty of
   40.15 +#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   40.16 +#    Lesser General Public License for more details.
   40.17 +#
   40.18 +#    You should have received a copy of the GNU Lesser General Public
   40.19 +#    License along with this library; if not, write to the Free Software
   40.20 +#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   40.21 +# =============================================================================
   40.22 +# Author:       Dr. Gareth S. Bestor <bestor@us.ibm.com>
   40.23 +# Contributors:
   40.24 +# Description:
   40.25 +#    RPM spec file for the CMPI Xen provider.
   40.26 +# =============================================================================
   40.27 +
   40.28 +Summary: CMPI Xen provider
   40.29 +Name: @PACKAGE_TARNAME@
   40.30 +Version: @PACKAGE_VERSION@
   40.31 +Release: @CIMSERVER@
   40.32 +Group: Systems Management/Base
   40.33 +License: GNU Lesser General Public Version 2.1
   40.34 +Requires: cimserver
   40.35 +
   40.36 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
   40.37 +BuildRequires: cmpi-devel
   40.38 +Source0: http://prdownloads.sourceforge.net/sblim/%{name}-%{version}.tar.bz2
   40.39 +
   40.40 +# -----------------------------------------------------------------------------
   40.41 +
   40.42 +%Description
   40.43 +TODO
   40.44 +
   40.45 +# -----------------------------------------------------------------------------
   40.46 +
   40.47 +%prep
   40.48 +%setup -n %{name}-%{version}
   40.49 +
   40.50 +export PATCH_GET=0
   40.51 +#%patch0 -p0
   40.52 +
   40.53 +# -----------------------------------------------------------------------------
   40.54 +
   40.55 +%build
   40.56 +%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite CIMSERVER=@CIMSERVER@
   40.57 +make
   40.58 +
   40.59 +# -----------------------------------------------------------------------------
   40.60 +                                                                                                                
   40.61 +%clean
   40.62 +# paranoia check
   40.63 +if [ `id -ur` != 0 ]
   40.64 +then
   40.65 +   rm -rf $RPM_BUILD_ROOT
   40.66 +fi
   40.67 +
   40.68 +# -----------------------------------------------------------------------------
   40.69 +
   40.70 +%install
   40.71 +# paranoia check
   40.72 +if [ `id -ur` != 0 ]
   40.73 +then
   40.74 +   rm -rf $RPM_BUILD_ROOT 
   40.75 +fi
   40.76 +
   40.77 +make DESTDIR=$RPM_BUILD_ROOT install
   40.78 +
   40.79 +# Remove unused libtool files
   40.80 +rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a
   40.81 +
   40.82 +# -----------------------------------------------------------------------------
   40.83 +
   40.84 +%post
   40.85 +
   40.86 +# LIST PROVIDER CLASS SCHEMA AND REGISTRATION FILES HERE
   40.87 +%define SCHEMA %{_datadir}/%{name}/Xen_ComputerSystem.mof
   40.88 +%define REGISTRATION %{_datadir}/%{name}/Xen_ComputerSystem.registration
   40.89 +
   40.90 +# Register Schema and Provider
   40.91 +%{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \
   40.92 +        -r %{REGISTRATION} -m %{SCHEMA} > /dev/null
   40.93 +
   40.94 +/sbin/ldconfig
   40.95 +
   40.96 +# -----------------------------------------------------------------------------
   40.97 +                                                                                
   40.98 +%preun
   40.99 +
  40.100 +# De-Register Schema and Provider
  40.101 +%{_datadir}/%{name}/provider-register.sh -d -t @CIMSERVER@ \
  40.102 +        -r %{REGISTRATION} -m %{SCHEMA} > /dev/null
  40.103 +                                                                                
  40.104 +%postun
  40.105 +/sbin/ldconfig
  40.106 +                                                                                
  40.107 +# -----------------------------------------------------------------------------
  40.108 +
  40.109 +%files
  40.110 +%defattr(-,root,root)
  40.111 +%{_datadir}/%{name}
  40.112 +%{_datadir}/doc/%{name}-%{version}
  40.113 +%{_libdir}/cmpi/*.so*
  40.114 +