os-cmpi-xen

view src/Xen_Console_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 a11f71a8dc62
children
line source
1 // Copyright (C) 2006 Unisys 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: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
18 //
19 // Contributors:
20 //
21 // Description:
22 // ============================================================================
24 /* Include required libxen headers. */
25 #include <xen_common.h>
26 #include <xen_console.h>
28 #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 struct {
37 xen_console_set *consoles;
38 unsigned int currentconsolenum;
39 } _RESOURCES;
41 /*** CUSTOMIZE FOR EACH PROVIDER ***/
42 /* DEFINE A HANDLE TO BE USED FOR EACH INSTANCE OF A SYSTEM RESOURCE.
43 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW EACH
44 RESOURCE IS REPRESENTED, BUT TYPICALLY IT IS A STRUCTURE MIRRORING THE
45 PROPERTIES IN THE CIM CLASS. THIS HANDLE IS PASSED BETWEEN THE RESOURCE
46 ACCESS METHODS WHEN MANIPULATING SPECIFIC RESOURCE INSTANCES. */
47 typedef xen_console_record _RESOURCE;
49 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
51 /* Include the required CMPI data types. */
52 #include "cmpidt.h"
54 // ----------------------------------------------------------------------------
55 // Generic resource access methods for CMPI providers.
56 // Return value:
57 // -1 = Unsupported
58 // 0 = Failed
59 // 1 = OK
60 // ----------------------------------------------------------------------------
62 /* Get a handle to the list of all system resources for this class. */
63 int Xen_Console_getResources(xen_utils_session *session,
64 _RESOURCES ** resources);
66 /* Free/deallocate/cleanup the resources list after use. */
67 int Xen_Console_freeResources(_RESOURCES * resources);
69 /* Iterator to get the next resource from the resources list. */
70 int Xen_Console_getNextResource(xen_utils_session *session,
71 _RESOURCES * resources,
72 _RESOURCE ** resource);
74 /* Get the specific resource that matches the CMPI object path. */
75 int Xen_Console_getResourceForObjectPath(xen_utils_session *session,
76 _RESOURCE ** resource,
77 const CMPIObjectPath * objectpath);
79 /* Free/deallocate/cleanup a resource after use. */
80 int Xen_Console_freeResource(_RESOURCE * resource);
82 /* Set the property values of a CMPI instance from a specific resource. */
83 int Xen_Console_setInstanceFromResource(xen_utils_session *session,
84 _RESOURCE * resource,
85 const CMPIInstance * instance,
86 const CMPIBroker * broker);
88 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
90 /* Delete the specified resource from the system. */
91 int Xen_Console_deleteResource(_RESOURCES * resources,
92 _RESOURCE * resource);
94 /* Modify the specified resource using the property values of a CMPI instance. */
95 int Xen_Console_setResourceFromInstance(_RESOURCE * resource,
96 const CMPIInstance * instance,
97 const CMPIBroker * broker);
99 /* Create a new resource using the property values of a CMPI instance. */
100 int Xen_Console_createResourceFromInstance(_RESOURCES * resources,
101 _RESOURCE ** resource,
102 const CMPIInstance * instance,
103 const CMPIBroker * broker);