os-cmpi-xen

view src/Xen_OperatingSystem_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;
45 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
47 /* Include the required CMPI data types. */
48 #include "cmpidt.h"
50 // ----------------------------------------------------------------------------
51 // Generic resource access methods for CMPI providers.
52 // Return value:
53 // -1 = Unsupported
54 // 0 = Failed
55 // 1 = OK
56 // ----------------------------------------------------------------------------
58 /* Get a handle to the list of all system resources for this class. */
59 int Xen_OperatingSystem_getResources(xen_utils_session *session,
60 _RESOURCES ** resources);
62 /* Free/deallocate/cleanup the resources list after use. */
63 int Xen_OperatingSystem_freeResources(_RESOURCES * resources);
65 /* Iterator to get the next resource from the resources list. */
66 int Xen_OperatingSystem_getNextResource(xen_utils_session *session,
67 _RESOURCES * resources,
68 _RESOURCE ** resource);
70 /* Get the specific resource that matches the CMPI object path. */
71 int Xen_OperatingSystem_getResourceForObjectPath(xen_utils_session *session,
72 _RESOURCES * resources,
73 _RESOURCE ** resource,
74 const CMPIObjectPath * objectpath);
76 /* Free/deallocate/cleanup a resource after use. */
77 int Xen_OperatingSystem_freeResource(_RESOURCE * resource);
79 /* Set the property values of a CMPI instance from a specific resource. */
80 int Xen_OperatingSystem_setInstanceFromResource(xen_utils_session *session,
81 _RESOURCE * resource,
82 const CMPIInstance * instance,
83 const CMPIBroker * broker);
85 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
87 /* Delete the specified resource from the system. */
88 int Xen_OperatingSystem_deleteResource(_RESOURCES * resources,
89 _RESOURCE * resource);
91 /* Modify the specified resource using the property values of a CMPI instance. */
92 int Xen_OperatingSystem_setResourceFromInstance(_RESOURCE * resource,
93 const CMPIInstance * instance,
94 const CMPIBroker * broker);
96 /* Create a new resource using the property values of a CMPI instance. */
97 int Xen_OperatingSystem_createResourceFromInstance(_RESOURCES * resources,
98 _RESOURCE ** resource,
99 const CMPIInstance * instance,
100 const CMPIBroker * broker);