os-cmpi-xen

view src/Xen_MemoryCapabilitiesSettingData_Resource.h @ 121:4868ace2726b

Add initial consistence checks in test suite for Xen_MemoryPool, Xen_ProcessorPool and Xen_VirtualSystemManagementService.

Signed-off-by: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri Jun 08 10:22:05 2007 -0600 (2007-06-08)
parents 33d4316c01a2
children
line source
1 // Copyright (C) 2006 IBM Corporation
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 // ============================================================================
17 // Authors: Dr. Gareth S. Bestor, <bestor@us.ibm.com>
18 // Contributors: Jim Fehlig, <jfehlig@novell.com>
19 // Description:
20 // ============================================================================
22 /*** CUSTOMIZE FOR EACH PROVIDER ***/
23 /* DEFINE A HANDLE TO REPRESENT THE 'LIST' OF ALL SYSTEM RESOURCES.
24 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW THIS
25 LIST IS IMPLEMENTED - IT MAY BE AN ARRAY, LINKED LIST, FILE, ETC.
26 THIS HANDLE IS PASSED INTO THE APPROPRIATE RESOURCE ACCESS METHODS WHEN
27 ACCESSING/ITERATING/ADDING/REMOVING RESOURCES INSTANCES. */
28 typedef struct {
29 unsigned int currentsettingdatanum;
30 } _RESOURCES;
32 /*** CUSTOMIZE FOR EACH PROVIDER ***/
33 /* DEFINE A HANDLE TO BE USED FOR EACH INSTANCE OF A SYSTEM RESOURCE.
34 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW EACH
35 RESOURCE IS REPRESENTED, BUT TYPICALLY IT IS A STRUCTURE MIRRORING THE
36 PROPERTIES IN THE CIM CLASS. THIS HANDLE IS PASSED BETWEEN THE RESOURCE
37 ACCESS METHODS WHEN MANIPULATING SPECIFIC RESOURCE INSTANCES. */
38 typedef struct {
39 char instanceid[1024];
40 unsigned long long reservation;
41 unsigned long long limit;
42 unsigned long long quantity;
43 unsigned long weight;
44 } _RESOURCE;
46 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
48 /* Include the required CMPI data types. */
49 #include "cmpidt.h"
51 // ----------------------------------------------------------------------------
52 // Generic resource access methods for CMPI providers.
53 // Return value:
54 // -1 = Unsupported
55 // 0 = Failed
56 // 1 = OK
57 // ----------------------------------------------------------------------------
59 /* Get a handle to the list of all system resources for this class. */
60 int Xen_MemoryCapabilitiesSettingData_getResources( _RESOURCES ** resources );
62 /* Free/deallocate/cleanup the resources list after use. */
63 int Xen_MemoryCapabilitiesSettingData_freeResources( _RESOURCES * resources );
65 /* Iterator to get the next resource from the resources list. */
66 int Xen_MemoryCapabilitiesSettingData_getNextResource( _RESOURCES * resources, _RESOURCE ** resource );
68 /* Get the specific resource that matches the CMPI object path. */
69 int Xen_MemoryCapabilitiesSettingData_getResourceForObjectPath( _RESOURCES * resources, _RESOURCE ** resource, const CMPIObjectPath * objectpath );
71 /* Free/deallocate/cleanup a resource after use. */
72 int Xen_MemoryCapabilitiesSettingData_freeResource( _RESOURCE * resource );
74 /* Set the property values of a CMPI instance from a specific resource. */
75 int Xen_MemoryCapabilitiesSettingData_setInstanceFromResource( _RESOURCE * resource, const CMPIInstance * instance, const CMPIBroker * broker, _RESOURCES * resources );
77 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
79 /* Delete the specified resource from the system. */
80 int Xen_MemoryCapabilitiesSettingData_deleteResource( _RESOURCES * resources, _RESOURCE * resource );
82 /* Modify the specified resource using the property values of a CMPI instance. */
83 int Xen_MemoryCapabilitiesSettingData_setResourceFromInstance( _RESOURCE * resource, const CMPIInstance * instance, const CMPIBroker * broker );
85 /* Create a new resource using the property values of a CMPI instance. */
86 int Xen_MemoryCapabilitiesSettingData_createResourceFromInstance( _RESOURCES * resources, _RESOURCE ** resource, const CMPIInstance * instance, const CMPIBroker * broker );