os-cmpi-xen

view src/Xen_HostedMemory.c @ 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 ab8e99c757f5
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 // Tokunbo Adeshiyan, <tokunbo@us.ibm.com>
19 // Contributors: Jim Fehlig, <jfehlig@novell.com>
20 // Description:
21 // ============================================================================
23 #include <string.h>
25 /* Include the required CMPI data types, function headers, and macros */
26 #include "cmpidt.h"
27 #include "cmpift.h"
28 #include "cmpimacs.h"
31 // ----------------------------------------------------------------------------
32 // COMMON GLOBAL VARIABLES
33 // ----------------------------------------------------------------------------
35 /* Handle to the CIM broker. Initialized when the provider lib is loaded. */
36 static const CMPIBroker *_BROKER;
38 /* Include utility functions */
39 #include "cmpiutil.h"
41 /* Include _SBLIM_TRACE() logging support */
42 #include "cmpitrace.h"
45 // ============================================================================
46 // CMPI ASSOCIATION PROVIDER FUNCTION TABLE
47 // ============================================================================
49 // ----------------------------------------------------------------------------
50 // Info for the class supported by the association provider
51 // ----------------------------------------------------------------------------
53 /* Name of the left and right hand side classes of this association. */
54 static char * _ASSOCCLASS = "Xen_HostedMemory";
55 static char * _LHSCLASSNAME = "Xen_Memory";
56 //static char * _RHSCLASSNAME = "Linux_CacheMemory";
57 static char * _RHSCLASSNAME = "CIM_Memory";
58 static char * _LHSPROPERTYNAME = "Dependent";
59 static char * _RHSPROPERTYNAME = "Antecedent";
61 // ----------------------------------------------------------------------------
62 // AssociationCleanup()
63 // Perform any necessary cleanup immediately before this provider is unloaded.
64 // ----------------------------------------------------------------------------
65 static CMPIStatus AssociationCleanup(
66 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
67 const CMPIContext * context, /* [in] Additional context info, if any. */
68 CMPIBoolean terminating) /* [in] True if MB is terminating */
69 {
70 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
72 _SBLIM_ENTER("AssociationCleanup");
73 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
74 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
76 /* Nothing needs to be done for cleanup. */
77 _SBLIM_RETURNSTATUS(status);
78 }
81 // ----------------------------------------------------------------------------
82 // AssociatorNames()
83 // ----------------------------------------------------------------------------
84 static CMPIStatus AssociatorNames(
85 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
86 const CMPIContext * context, /* [in] Additional context info, if any. */
87 const CMPIResult * results, /* [out] Results of this operation. */
88 const CMPIObjectPath * reference, /* [in] Contains source namespace, classname and object path. */
89 const char * assocClass,
90 const char * resultClass,
91 const char * role,
92 const char * resultRole)
93 {
94 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
95 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
96 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
97 char *targetclass; /* Class of the target object(s). */
99 _SBLIM_ENTER("AssociatorNames");
100 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
101 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
102 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
103 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
104 _SBLIM_TRACE(2, ("--- resultClass=\"%s\"", resultClass));
105 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
106 _SBLIM_TRACE(2, ("--- resultRole=\"%s\"", resultRole));
107 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
108 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
110 /* Check that the requested association class, if any, is supported. */
111 if (assocClass != NULL) {
112 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
113 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
114 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
115 goto exit;
116 }
117 }
119 /* Check that the reference matches the required role, if any. */
120 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
121 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
122 goto exit;
123 }
125 /* Determine the target class from the source class. */
126 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
127 targetclass = _RHSCLASSNAME;
128 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
129 targetclass = _LHSCLASSNAME;
130 } else {
131 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
132 goto exit;
133 }
134 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
136 /* Create an object path for the result class. */
137 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
138 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
139 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
140 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
141 goto exit;
142 }
144 /* Get the list of all target class object paths from the CIMOM. */
145 CMPIEnumeration * objectpaths = CBEnumInstanceNames(_BROKER, context, objectpath, &status);
146 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpaths)) {
147 _SBLIM_TRACE(1,("--- CBEnumInstanceNames() failed - %s", CMGetCharPtr(status.msg)));
148 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
149 goto exit;
150 }
152 /* Return all object paths that exactly match the target class and resultClass, if specified. */
153 while (CMHasNext(objectpaths, NULL)) {
154 CMPIData data = CMGetNext(objectpaths, NULL);
155 char *class = CMGetCharPtr(CMGetClassName(data.value.ref, NULL));
156 if ((strcmp(class,targetclass) == 0) && ((resultClass == NULL) || (strcmp(class,resultClass) == 0))) {
157 CMReturnObjectPath(results, data.value.ref);
158 }
159 }
161 CMReturnDone(results);
163 exit:
164 _SBLIM_RETURNSTATUS(status);
165 }
168 // ----------------------------------------------------------------------------
169 // Associators()
170 // ----------------------------------------------------------------------------
171 static CMPIStatus Associators(
172 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
173 const CMPIContext * context, /* [in] Additional context info, if any. */
174 const CMPIResult * results, /* [out] Results of this operation. */
175 const CMPIObjectPath * reference, /* [in] Contains the source namespace, classname and object path. */
176 const char *assocClass,
177 const char *resultClass,
178 const char *role,
179 const char *resultRole,
180 const char ** properties) /* [in] List of desired properties (NULL=all). */
181 {
182 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
183 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
184 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
185 char *targetclass; /* Class of the target object(s). */
187 _SBLIM_ENTER("Associators");
188 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
189 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
190 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
191 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
192 _SBLIM_TRACE(2, ("--- resultClass=\"%s\"", resultClass));
193 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
194 _SBLIM_TRACE(2, ("--- resultRole=\"%s\"", resultRole));
195 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
196 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
198 /* Check that the requested association class, if any, is supported. */
199 if (assocClass != NULL) {
200 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
201 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
202 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
203 goto exit;
204 }
205 }
207 /* Check that the reference matches the required role, if any. */
208 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
209 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
210 goto exit;
211 }
213 /* Determine the target class from the source class. */
214 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
215 targetclass = _RHSCLASSNAME;
216 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
217 targetclass = _LHSCLASSNAME;
218 } else {
219 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
220 goto exit;
221 }
222 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
224 /* Create an object path for the result class. */
225 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
226 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
227 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
228 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
229 goto exit;
230 }
232 /* Get the list of all target class instances from the CIMOM. */
233 CMPIEnumeration * instances = CBEnumInstances(_BROKER, context, objectpath, NULL, &status);
234 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(instances)) {
235 _SBLIM_TRACE(1,("--- CBEnumInstances() failed - %s", CMGetCharPtr(status.msg)));
236 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
237 goto exit;
238 }
240 /* Return all instances that exactly match the target class and resultClass, if specified. */
241 while (CMHasNext(instances, NULL)) {
242 CMPIData data = CMGetNext(instances, NULL);
243 char *class = CMGetCharPtr(CMGetClassName(CMGetObjectPath(data.value.inst,NULL), NULL));
244 if ((strcmp(class,targetclass) == 0) && ((resultClass == NULL) || (strcmp(class,resultClass) == 0))) {
245 // BUG - returning data causes crash !?!
246 _SBLIM_TRACE(2, ("--- data.value.inst=\"%s\"", CMGetCharPtr(CDToString(_BROKER, data.value.inst, NULL))));
247 CMReturnInstance(results, data.value.inst);
248 }
249 }
251 CMReturnDone(results);
253 exit:
254 _SBLIM_RETURNSTATUS(status);
255 }
258 // ----------------------------------------------------------------------------
259 // ReferenceNames()
260 // ----------------------------------------------------------------------------
261 static CMPIStatus ReferenceNames(
262 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
263 const CMPIContext * context, /* [in] Additional context info, if any. */
264 const CMPIResult * results, /* [out] Results of this operation. */
265 const CMPIObjectPath * reference, /* [in] Contains the source namespace, classname and object path. */
266 const char *assocClass,
267 const char *role)
268 {
269 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
270 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
271 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
272 char *targetclass; /* Class of the target object(s). */
274 _SBLIM_ENTER("ReferenceNames");
275 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
276 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
277 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
278 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
279 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
280 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
281 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
283 /* Check that the requested association class, if any, is supported. */
284 if (assocClass != NULL) {
285 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
286 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
287 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
288 goto exit;
289 }
290 }
292 /* Check that the reference matches the required role, if any. */
293 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
294 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
295 goto exit;
296 }
298 /* Determine the target class from the source class. */
299 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
300 targetclass = _RHSCLASSNAME;
301 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
302 targetclass = _LHSCLASSNAME;
303 } else {
304 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
305 goto exit;
306 }
307 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
309 /* Create an object path for the result class. */
310 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
311 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
312 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
313 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
314 goto exit;
315 }
317 /* Get the list of all target class object paths from the CIMOM. */
318 CMPIEnumeration * objectpaths = CBEnumInstanceNames(_BROKER, context, objectpath, &status);
319 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpaths)) {
320 _SBLIM_TRACE(1,("--- CBEnumInstanceNames() failed - %s", CMGetCharPtr(status.msg)));
321 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
322 goto exit;
323 }
325 /* Return all object paths that exactly match the target class and resultClass, if specified. */
326 while (CMHasNext(objectpaths, NULL)) {
327 CMPIData data = CMGetNext(objectpaths, NULL);
328 char *class = CMGetCharPtr(CMGetClassName(data.value.ref, NULL));
329 if (strcmp(class,targetclass) == 0) {
331 /* Create an object path for the association. */
332 CMPIObjectPath * refobjectpath = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, &status);
333 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(refobjectpath)) {
334 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
335 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
336 goto exit;
337 }
339 /* Assign the references in the association appropriately. */
340 if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
341 CMAddKey(refobjectpath, _RHSPROPERTYNAME, &reference, CMPI_ref);
342 CMAddKey(refobjectpath, _LHSPROPERTYNAME, &data.value.ref, CMPI_ref);
343 } else {
344 CMAddKey(refobjectpath, _RHSPROPERTYNAME, &data.value.ref, CMPI_ref);
345 CMAddKey(refobjectpath, _LHSPROPERTYNAME, &reference, CMPI_ref);
346 }
348 CMReturnObjectPath(results, refobjectpath);
349 }
350 }
352 exit:
353 _SBLIM_RETURNSTATUS(status);
354 }
357 // ----------------------------------------------------------------------------
358 // References()
359 // ----------------------------------------------------------------------------
360 static CMPIStatus References(
361 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
362 const CMPIContext * context, /* [in] Additional context info, if any. */
363 const CMPIResult * results, /* [out] Results of this operation. */
364 const CMPIObjectPath * reference, /* [in] Contains the namespace, classname and desired object path. */
365 const char *assocClass,
366 const char *role,
367 const char **properties) /* [in] List of desired properties (NULL=all). */
368 {
369 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
370 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
371 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
372 char *targetclass; /* Class of the target object(s). */
374 _SBLIM_ENTER("References");
375 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
376 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
377 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
378 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
379 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
380 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
381 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
383 /* Check that the requested association class, if any, is supported. */
384 if (assocClass != NULL) {
385 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
386 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
387 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
388 goto exit;
389 }
390 }
392 /* Check that the reference matches the required role, if any. */
393 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
394 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
395 goto exit;
396 }
398 /* Determine the target class from the source class. */
399 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
400 targetclass = _RHSCLASSNAME;
401 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
402 targetclass = _LHSCLASSNAME;
403 } else {
404 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
405 goto exit;
406 }
407 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
409 /* Create an object path for the result class. */
410 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
411 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
412 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
413 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
414 goto exit;
415 }
417 /* Get the list of all target class object paths from the CIMOM. */
418 CMPIEnumeration * objectpaths = CBEnumInstanceNames(_BROKER, context, objectpath, &status);
419 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpaths)) {
420 _SBLIM_TRACE(1,("--- CBEnumInstanceNames() failed - %s", CMGetCharPtr(status.msg)));
421 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
422 goto exit;
423 }
425 /* Return all object paths that exactly match the target class and resultClass, if specified. */
426 while (CMHasNext(objectpaths, NULL)) {
427 CMPIData data = CMGetNext(objectpaths, NULL);
428 char *class = CMGetCharPtr(CMGetClassName(data.value.ref, NULL));
429 if (strcmp(class,targetclass) == 0) {
431 /* Create an instance for the association. */
432 CMPIInstance * refinstance = _CMNewInstance(_BROKER, namespace, _ASSOCCLASS, &status);
433 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(refinstance)) {
434 _SBLIM_TRACE(1,("--- CMNewInstance() failed - %s", CMGetCharPtr(status.msg)));
435 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIInstance");
436 goto exit;
437 }
439 /* Assign the references in the association appropriately. */
440 if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
441 CMSetProperty(refinstance, _RHSPROPERTYNAME, &reference, CMPI_ref);
442 CMSetProperty(refinstance, _LHSPROPERTYNAME, &data.value.ref, CMPI_ref);
443 } else {
444 CMSetProperty(refinstance, _RHSPROPERTYNAME, &data.value.ref, CMPI_ref);
445 CMSetProperty(refinstance, _LHSPROPERTYNAME, &reference, CMPI_ref);
446 }
448 CMReturnInstance(results, refinstance);
449 }
450 }
451 exit:
452 _SBLIM_RETURNSTATUS(status);
453 }
456 // ----------------------------------------------------------------------------
457 // AssociationInitialize()
458 // Perform any necessary initialization immediately after this provider is
459 // first loaded.
460 // ----------------------------------------------------------------------------
461 static void AssociationInitialize(
462 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
463 const CMPIContext * context) /* [in] Additional context info, if any. */
464 {
465 _SBLIM_ENTER("AssociationInitialize");
466 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
467 // _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
469 /* Nothing needs to be done to initialize this provider */
470 _SBLIM_RETURN();
471 }
474 // ============================================================================
475 // CMPI ASSOCIATION PROVIDER FUNCTION TABLE SETUP
476 // ============================================================================
477 CMAssociationMIStub( , Xen_HostedMemory, _BROKER, AssociationInitialize(&mi, ctx));