os-cmpi-xen

view src/Xen_ComputerSystemCapabilities_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 e0f068d0632a
children
line source
1 // Copyright (C) 2006 Novell, Inc.
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: Jim Fehlig, <jfehlig@novell.com>
18 // Contributors:
19 // Description: Encapsulates the resources used to instrument
20 // Xen_ComputerSystemCapabilities.
21 // ============================================================================
23 /* Include required libxen headers. */
24 #include <xen_common.h>
25 #include <xen_vm.h>
27 #include "xen_utils.h"
30 /*** CUSTOMIZE FOR EACH PROVIDER ***/
31 /* DEFINE A HANDLE TO REPRESENT THE 'LIST' OF ALL SYSTEM RESOURCES.
32 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW THIS
33 LIST IS IMPLEMENTED - IT MAY BE AN ARRAY, LINKED LIST, FILE, ETC.
34 THIS HANDLE IS PASSED INTO THE APPROPRIATE RESOURCE ACCESS METHODS WHEN
35 ACCESSING/ITERATING/ADDING/REMOVING RESOURCES INSTANCES. */
36 typedef xen_domain_resources _RESOURCES;
39 /*** CUSTOMIZE FOR EACH PROVIDER ***/
40 /* DEFINE A HANDLE TO BE USED FOR EACH INSTANCE OF A SYSTEM RESOURCE.
41 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW EACH
42 RESOURCE IS REPRESENTED, BUT TYPICALLY IT IS A STRUCTURE MIRRORING THE
43 PROPERTIES IN THE CIM CLASS. THIS HANDLE IS PASSED BETWEEN THE RESOURCE
44 ACCESS METHODS WHEN MANIPULATING SPECIFIC RESOURCE INSTANCES. */
45 typedef xen_vm_record _RESOURCE;
47 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
49 /* Include the required CMPI data types. */
50 #include "cmpidt.h"
52 // ----------------------------------------------------------------------------
53 // Generic resource access methods for CMPI providers.
54 // Return value:
55 // -1 = Unsupported
56 // 0 = Failed
57 // 1 = OK
58 // ----------------------------------------------------------------------------
60 /* Get a handle to the list of all system resources for this class. */
61 int Xen_ComputerSystemCapabilities_getResources(xen_utils_session *session,
62 _RESOURCES ** resources);
64 /* Free/deallocate/cleanup the resources list after use. */
65 int Xen_ComputerSystemCapabilities_freeResources(_RESOURCES * resources);
67 /* Iterator to get the next resource from the resources list. */
68 int Xen_ComputerSystemCapabilities_getNextResource(xen_utils_session *session,
69 _RESOURCES * resources,
70 _RESOURCE ** resource);
72 /* Get the specific resource that matches the CMPI object path. */
73 int Xen_ComputerSystemCapabilities_getResourceForObjectPath(xen_utils_session *session,
74 _RESOURCES * resources,
75 _RESOURCE ** resource,
76 const CMPIObjectPath * objectpath);
78 /* Free/deallocate/cleanup a resource after use. */
79 int Xen_ComputerSystemCapabilities_freeResource(_RESOURCE * resource);
81 /* Set the property values of a CMPI instance from a specific resource. */
82 int Xen_ComputerSystemCapabilities_setInstanceFromResource(_RESOURCE * resource,
83 const CMPIInstance * instance,
84 const CMPIBroker * broker);
86 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
88 /* Delete the specified resource from the system. */
89 int Xen_ComputerSystemCapabilities_deleteResource(_RESOURCES * resources,
90 _RESOURCE * resource);
92 /* Modify the specified resource using the property values of a CMPI instance. */
93 int Xen_ComputerSystemCapabilities_setResourceFromInstance(_RESOURCE * resource,
94 const CMPIInstance * instance,
95 const CMPIBroker * broker);
97 /* Create a new resource using the property values of a CMPI instance. */
98 int Xen_ComputerSystemCapabilities_createResourceFromInstance(_RESOURCES * resources,
99 _RESOURCE ** resource,
100 const CMPIInstance * instance,
101 const CMPIBroker * broker);