os-cmpi-xen

view src/Xen_ProcessorSettingData_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 7ca3bbf0810a
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 /* Include required libxen headers. */
23 #include <xen_common.h>
24 #include <xen_vm.h>
26 #include "xen_utils.h"
28 /*** CUSTOMIZE FOR EACH PROVIDER ***/
29 /* DEFINE A HANDLE TO REPRESENT THE 'LIST' OF ALL SYSTEM RESOURCES.
30 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW THIS
31 LIST IS IMPLEMENTED - IT MAY BE AN ARRAY, LINKED LIST, FILE, ETC.
32 THIS HANDLE IS PASSED INTO THE APPROPRIATE RESOURCE ACCESS METHODS WHEN
33 ACCESSING/ITERATING/ADDING/REMOVING RESOURCES INSTANCES. */
34 typedef xen_domain_resources _RESOURCES;
36 /*** CUSTOMIZE FOR EACH PROVIDER ***/
37 /* DEFINE A HANDLE TO BE USED FOR EACH INSTANCE OF A SYSTEM RESOURCE.
38 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW EACH
39 RESOURCE IS REPRESENTED, BUT TYPICALLY IT IS A STRUCTURE MIRRORING THE
40 PROPERTIES IN THE CIM CLASS. THIS HANDLE IS PASSED BETWEEN THE RESOURCE
41 ACCESS METHODS WHEN MANIPULATING SPECIFIC RESOURCE INSTANCES. */
42 typedef xen_vm_record _RESOURCE;
44 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
46 /* Include the required CMPI data types. */
47 #include "cmpidt.h"
49 // ----------------------------------------------------------------------------
50 // Generic resource access methods for CMPI providers.
51 // Return value:
52 // -1 = Unsupported
53 // 0 = Failed
54 // 1 = OK
55 // ----------------------------------------------------------------------------
57 /* Get a handle to the list of all system resources for this class. */
58 int Xen_ProcessorSettingData_getResources(xen_utils_session *session,
59 _RESOURCES ** resources);
61 /* Free/deallocate/cleanup the resources list after use. */
62 int Xen_ProcessorSettingData_freeResources(_RESOURCES * resources);
64 /* Iterator to get the next resource from the resources list. */
65 int Xen_ProcessorSettingData_getNextResource(xen_utils_session *session,
66 _RESOURCES * resources,
67 _RESOURCE ** resource);
69 /* Get the specific resource that matches the CMPI object path. */
70 int Xen_ProcessorSettingData_getResourceForObjectPath(xen_utils_session *session,
71 _RESOURCES * resources,
72 _RESOURCE ** resource,
73 const CMPIObjectPath * objectpath);
75 /* Free/deallocate/cleanup a resource after use. */
76 int Xen_ProcessorSettingData_freeResource(_RESOURCE * resource);
78 /* Set the property values of a CMPI instance from a specific resource. */
79 int Xen_ProcessorSettingData_setInstanceFromResource(xen_utils_session *session,
80 _RESOURCE * resource,
81 const CMPIInstance * instance,
82 const CMPIBroker * broker);
84 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
86 /* Delete the specified resource from the system. */
87 int Xen_ProcessorSettingData_deleteResource(_RESOURCES * resources,
88 _RESOURCE * resource);
90 /* Modify the specified resource using the property values of a CMPI instance. */
91 int Xen_ProcessorSettingData_setResourceFromInstance(_RESOURCE * resource,
92 const CMPIInstance * instance,
93 const CMPIBroker * broker);
95 /* Create a new resource using the property values of a CMPI instance. */
96 int Xen_ProcessorSettingData_createResourceFromInstance(_RESOURCES * resources,
97 _RESOURCE ** resource,
98 const CMPIInstance * instance,
99 const CMPIBroker * broker);