os-cmpi-xen

view src/Xen_ConsoleSettingData_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 75019e01e546
children
line source
1 // Copyright (C) 2007 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 //
19 // Contributors:
20 //
21 // Description:
22 // ============================================================================
23 #if !defined(__XEN_CONSOLESETTINGDATA_RESOURCE_H__)
24 #define __XEN_CONSOLESETTINGDATA_RESOURCE_H__
26 /* Include required libxen headers. */
27 #include <xen_common.h>
28 #include <xen_console.h>
30 #include "xen_utils.h"
32 /*** CUSTOMIZE FOR EACH PROVIDER ***/
33 /* DEFINE A HANDLE TO REPRESENT THE 'LIST' OF ALL SYSTEM RESOURCES.
34 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW THIS
35 LIST IS IMPLEMENTED - IT MAY BE AN ARRAY, LINKED LIST, FILE, ETC.
36 THIS HANDLE IS PASSED INTO THE APPROPRIATE RESOURCE ACCESS METHODS WHEN
37 ACCESSING/ITERATING/ADDING/REMOVING RESOURCES INSTANCES. */
38 typedef struct {
39 xen_console_set *consoles;
40 unsigned int currentconsolenum;
41 } _RESOURCES;
43 /*** CUSTOMIZE FOR EACH PROVIDER ***/
44 /* DEFINE A HANDLE TO BE USED FOR EACH INSTANCE OF A SYSTEM RESOURCE.
45 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW EACH
46 RESOURCE IS REPRESENTED, BUT TYPICALLY IT IS A STRUCTURE MIRRORING THE
47 PROPERTIES IN THE CIM CLASS. THIS HANDLE IS PASSED BETWEEN THE RESOURCE
48 ACCESS METHODS WHEN MANIPULATING SPECIFIC RESOURCE INSTANCES. */
49 typedef xen_console_record _RESOURCE;
51 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
53 /* Include the required CMPI data types. */
54 #include "cmpidt.h"
56 // ----------------------------------------------------------------------------
57 // Generic resource access methods for CMPI providers.
58 // Return value:
59 // -1 = Unsupported
60 // 0 = Failed
61 // 1 = OK
62 // ----------------------------------------------------------------------------
64 /* Get a handle to the list of all system resources for this class. */
65 int Xen_ConsoleSettingData_getResources(xen_utils_session *session,
66 _RESOURCES ** resources);
68 /* Free/deallocate/cleanup the resources list after use. */
69 int Xen_ConsoleSettingData_freeResources(_RESOURCES * resources);
71 /* Iterator to get the next resource from the resources list. */
72 int Xen_ConsoleSettingData_getNextResource(xen_utils_session *session,
73 _RESOURCES * resources,
74 _RESOURCE ** resource);
76 /* Get the specific resource that matches the CMPI object path. */
77 int Xen_ConsoleSettingData_getResourceForObjectPath(xen_utils_session *session,
78 _RESOURCE ** resource,
79 const CMPIObjectPath * objectpath);
81 /* Free/deallocate/cleanup a resource after use. */
82 int Xen_ConsoleSettingData_freeResource(_RESOURCE * resource);
84 /* Set the property values of a CMPI instance from a specific resource. */
85 int Xen_ConsoleSettingData_setInstanceFromResource(xen_utils_session *session,
86 _RESOURCE * resource,
87 const CMPIInstance * instance,
88 const CMPIBroker * broker);
90 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
92 /* Delete the specified resource from the system. */
93 int Xen_ConsoleSettingData_deleteResource(_RESOURCES * resources,
94 _RESOURCE * resource);
96 /* Modify the specified resource using the property values of a CMPI instance. */
97 int Xen_ConsoleSettingData_setResourceFromInstance(_RESOURCE * resource,
98 const CMPIInstance * instance,
99 const CMPIBroker * broker);
101 /* Create a new resource using the property values of a CMPI instance. */
102 int Xen_ConsoleSettingData_createResourceFromInstance(_RESOURCES * resources,
103 _RESOURCE ** resource,
104 const CMPIInstance * instance,
105 const CMPIBroker * broker);
107 #endif /* __XEN_CONSOLESETTINGDATA_RESOURCE_H__ */