os-cmpi-xen

view src/Xen_MemoryAllocatedFromPool.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 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:
20 // ============================================================================
22 #include <string.h>
24 /* Include the required CMPI data types, function headers, and macros */
25 #include "cmpidt.h"
26 #include "cmpift.h"
27 #include "cmpimacs.h"
30 // ----------------------------------------------------------------------------
31 // COMMON GLOBAL VARIABLES
32 // ----------------------------------------------------------------------------
34 /* Handle to the CIM broker. Initialized when the provider lib is loaded. */
35 static const CMPIBroker *_BROKER;
37 /* Include utility functions */
38 #include "cmpiutil.h"
40 /* Include _SBLIM_TRACE() logging support */
41 #include "cmpitrace.h"
44 // ============================================================================
45 // CMPI ASSOCIATION PROVIDER FUNCTION TABLE
46 // ============================================================================
48 // ----------------------------------------------------------------------------
49 // Info for the class supported by the association provider
50 // ----------------------------------------------------------------------------
52 /* Name of the left and right hand side classes of this association. */
53 static char * _ASSOCCLASS = "Xen_MemoryAllocatedFromPool";
54 static char * _LHSCLASSNAME = "Xen_MemoryPool";
55 static char * _RHSCLASSNAME = "Xen_Memory";
56 static char * _LHSPROPERTYNAME = "Antecedent";
57 static char * _RHSPROPERTYNAME = "Dependent";
60 // ----------------------------------------------------------------------------
61 // AssociationCleanup()
62 // Perform any necessary cleanup immediately before this provider is unloaded.
63 // ----------------------------------------------------------------------------
64 static CMPIStatus AssociationCleanup(
65 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
66 const CMPIContext * context, /* [in] Additional context info, if any. */
67 CMPIBoolean terminating) /* [in] True if MB is terminating */
68 {
69 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
71 _SBLIM_ENTER("AssociationCleanup");
72 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
73 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
75 /* Nothing needs to be done for cleanup. */
76 _SBLIM_RETURNSTATUS(status);
77 }
80 // ----------------------------------------------------------------------------
81 // AssociatorNames()
82 // ----------------------------------------------------------------------------
83 static CMPIStatus AssociatorNames(
84 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
85 const CMPIContext * context, /* [in] Additional context info, if any. */
86 const CMPIResult * results, /* [out] Results of this operation. */
87 const CMPIObjectPath * reference, /* [in] Contains source namespace, classname and object path. */
88 const char * assocClass,
89 const char * resultClass,
90 const char * role,
91 const char * resultRole)
92 {
93 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
94 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
95 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
96 char *targetclass; /* Class of the target object(s). */
98 _SBLIM_ENTER("AssociatorNames");
99 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
100 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
101 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
102 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
103 _SBLIM_TRACE(2, ("--- resultClass=\"%s\"", resultClass));
104 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
105 _SBLIM_TRACE(2, ("--- resultRole=\"%s\"", resultRole));
106 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
107 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
109 /* Check that the requested association class, if any, is supported. */
110 if (assocClass != NULL) {
111 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
112 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
113 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
114 goto exit;
115 }
116 }
118 /* Check that the reference matches the required role, if any. */
119 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
120 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
121 goto exit;
122 }
124 /* Determine the target class from the source class. */
125 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
126 targetclass = _RHSCLASSNAME;
127 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
128 targetclass = _LHSCLASSNAME;
129 } else {
130 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
131 goto exit;
132 }
133 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
135 /* Create an object path for the result class. */
136 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
137 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
138 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
139 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
140 goto exit;
141 }
143 /* Get the list of all target class object paths from the CIMOM. */
144 CMPIEnumeration * objectpaths = CBEnumInstanceNames(_BROKER, context, objectpath, &status);
145 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpaths)) {
146 _SBLIM_TRACE(1,("--- CBEnumInstanceNames() failed - %s", CMGetCharPtr(status.msg)));
147 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
148 goto exit;
149 }
151 /* Return all object paths that exactly match the target class and resultClass, if specified. */
152 while (CMHasNext(objectpaths, NULL)) {
153 CMPIData data = CMGetNext(objectpaths, NULL);
154 _SBLIM_TRACE(2, ("--- got objectpath=\"%s\"", CMGetCharPtr(CDToString(_BROKER, data.value.ref, NULL))));
156 if (CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL) &&
157 (resultClass == NULL || CMClassPathIsA(_BROKER, data.value.ref, resultClass, NULL))) {
158 CMReturnObjectPath(results, data.value.ref);
159 }
160 }
162 CMReturnDone(results);
164 exit:
165 _SBLIM_RETURNSTATUS(status);
166 }
169 // ----------------------------------------------------------------------------
170 // Associators()
171 // ----------------------------------------------------------------------------
172 static CMPIStatus Associators(
173 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
174 const CMPIContext * context, /* [in] Additional context info, if any. */
175 const CMPIResult * results, /* [out] Results of this operation. */
176 const CMPIObjectPath * reference, /* [in] Contains the source namespace, classname and object path. */
177 const char *assocClass,
178 const char *resultClass,
179 const char *role,
180 const char *resultRole,
181 const char ** properties) /* [in] List of desired properties (NULL=all). */
182 {
183 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
184 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
185 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
186 char *targetclass; /* Class of the target object(s). */
188 _SBLIM_ENTER("Associators");
189 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
190 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
191 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
192 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
193 _SBLIM_TRACE(2, ("--- resultClass=\"%s\"", resultClass));
194 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
195 _SBLIM_TRACE(2, ("--- resultRole=\"%s\"", resultRole));
196 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
197 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
199 /* Check that the requested association class, if any, is supported. */
200 if (assocClass != NULL) {
201 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
202 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
203 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
204 goto exit;
205 }
206 }
208 /* Check that the reference matches the required role, if any. */
209 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
210 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
211 goto exit;
212 }
214 /* Determine the target class from the source class. */
215 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
216 targetclass = _RHSCLASSNAME;
217 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
218 targetclass = _LHSCLASSNAME;
219 } else {
220 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
221 goto exit;
222 }
223 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
225 /* Create an object path for the result class. */
226 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
227 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
228 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
229 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
230 goto exit;
231 }
233 /* Get the list of all target class instances from the CIMOM. */
234 CMPIEnumeration * instances = CBEnumInstances(_BROKER, context, objectpath, NULL, &status);
235 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(instances)) {
236 _SBLIM_TRACE(1,("--- CBEnumInstances() failed - %s", CMGetCharPtr(status.msg)));
237 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
238 goto exit;
239 }
241 /* Return all instances that exactly match the target class and resultClass, if specified. */
242 while (CMHasNext(instances, NULL)) {
243 CMPIData data = CMGetNext(instances, NULL);
244 CMPIObjectPath *op = CMGetObjectPath(data.value.inst,NULL);
245 CMSetNameSpace(op, namespace);
246 _SBLIM_TRACE(2, ("--- got objectpath=\"%s\"", CMGetCharPtr(CDToString(_BROKER, op, NULL))));
248 if (CMClassPathIsA(_BROKER, op, targetclass, NULL) &&
249 (resultClass == NULL || CMClassPathIsA(_BROKER, op, resultClass, NULL))) {
250 CMReturnInstance(results, data.value.inst);
251 }
252 }
254 CMReturnDone(results);
256 exit:
257 _SBLIM_RETURNSTATUS(status);
258 }
261 // ----------------------------------------------------------------------------
262 // ReferenceNames()
263 // ----------------------------------------------------------------------------
264 static CMPIStatus ReferenceNames(
265 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
266 const CMPIContext * context, /* [in] Additional context info, if any. */
267 const CMPIResult * results, /* [out] Results of this operation. */
268 const CMPIObjectPath * reference, /* [in] Contains the source namespace, classname and object path. */
269 const char *assocClass,
270 const char *role)
271 {
272 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
273 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
274 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
275 char *targetclass; /* Class of the target object(s). */
277 _SBLIM_ENTER("ReferenceNames");
278 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
279 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
280 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
281 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
282 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
283 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
284 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
286 /* Check that the requested association class, if any, is supported. */
287 if (assocClass != NULL) {
288 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
289 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
290 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
291 goto exit;
292 }
293 }
295 /* Check that the reference matches the required role, if any. */
296 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
297 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
298 goto exit;
299 }
301 /* Determine the target class from the source class. */
302 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
303 targetclass = _RHSCLASSNAME;
304 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
305 targetclass = _LHSCLASSNAME;
306 } else {
307 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
308 goto exit;
309 }
310 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
312 /* Create an object path for the result class. */
313 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
314 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
315 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
316 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
317 goto exit;
318 }
320 /* Get the list of all target class object paths from the CIMOM. */
321 CMPIEnumeration * objectpaths = CBEnumInstanceNames(_BROKER, context, objectpath, &status);
322 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpaths)) {
323 _SBLIM_TRACE(1,("--- CBEnumInstanceNames() failed - %s", CMGetCharPtr(status.msg)));
324 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
325 goto exit;
326 }
328 /* Return all object paths that exactly match the target class and resultClass, if specified. */
329 while (CMHasNext(objectpaths, NULL)) {
330 CMPIData data = CMGetNext(objectpaths, NULL);
332 if (CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL)) {
333 /* Create an object path for the association. */
334 CMPIObjectPath * refobjectpath = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, &status);
335 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(refobjectpath)) {
336 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
337 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
338 goto exit;
339 }
341 /* Assign the references in the association appropriately. */
342 if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
343 CMAddKey(refobjectpath, _RHSPROPERTYNAME, &reference, CMPI_ref);
344 CMAddKey(refobjectpath, _LHSPROPERTYNAME, &data.value.ref, CMPI_ref);
345 } else {
346 CMAddKey(refobjectpath, _RHSPROPERTYNAME, &data.value.ref, CMPI_ref);
347 CMAddKey(refobjectpath, _LHSPROPERTYNAME, &reference, CMPI_ref);
348 }
350 CMReturnObjectPath(results, refobjectpath);
351 }
352 }
354 exit:
355 _SBLIM_RETURNSTATUS(status);
356 }
359 // ----------------------------------------------------------------------------
360 // References()
361 // ----------------------------------------------------------------------------
362 static CMPIStatus References(
363 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
364 const CMPIContext * context, /* [in] Additional context info, if any. */
365 const CMPIResult * results, /* [out] Results of this operation. */
366 const CMPIObjectPath * reference, /* [in] Contains the namespace, classname and desired object path. */
367 const char *assocClass,
368 const char *role,
369 const char **properties) /* [in] List of desired properties (NULL=all). */
370 {
371 CMPIStatus status = { CMPI_RC_OK, NULL }; /* Return status of CIM operations. */
372 char *namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); /* Target namespace. */
373 char *sourceclass = CMGetCharPtr(CMGetClassName(reference, &status)); /* Class of the source reference object */
374 char *targetclass; /* Class of the target object(s). */
376 _SBLIM_ENTER("References");
377 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
378 _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
379 _SBLIM_TRACE(2, ("--- reference=\"%s\"", CMGetCharPtr(CDToString(_BROKER, reference, NULL))));
380 _SBLIM_TRACE(2, ("--- assocClass=\"%s\"", assocClass));
381 _SBLIM_TRACE(2, ("--- role=\"%s\"", role));
382 _SBLIM_TRACE(2, ("--- namespace=\"%s\"", namespace));
383 _SBLIM_TRACE(2, ("--- sourceclass=\"%s\"", sourceclass));
385 /* Check that the requested association class, if any, is supported. */
386 if (assocClass != NULL) {
387 CMPIObjectPath * assoc = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, NULL);
388 if (!CMClassPathIsA(_BROKER, assoc, assocClass, NULL)) {
389 _SBLIM_TRACE(2, ("--- Unrecognized association class. Ignoring request."));
390 goto exit;
391 }
392 }
394 /* Check that the reference matches the required role, if any. */
395 if ((role != NULL) && strcmp(role, sourceclass) != 0) {
396 _SBLIM_TRACE(2, ("--- Reference does not match required role. Ignoring request."));
397 goto exit;
398 }
400 /* Determine the target class from the source class. */
401 if (strcmp(sourceclass, _LHSCLASSNAME) == 0) {
402 targetclass = _RHSCLASSNAME;
403 } else if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
404 targetclass = _LHSCLASSNAME;
405 } else {
406 _SBLIM_TRACE(2, ("--- Unrecognized source class. Ignoring request."));
407 goto exit;
408 }
409 _SBLIM_TRACE(2, ("--- targetclass=\"%s\"", targetclass));
411 /* Create an object path for the result class. */
412 CMPIObjectPath * objectpath = CMNewObjectPath(_BROKER, namespace, targetclass, &status);
413 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpath)) {
414 _SBLIM_TRACE(1,("--- CMNewObjectPath() failed - %s", CMGetCharPtr(status.msg)));
415 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIObjectPath");
416 goto exit;
417 }
419 /* Get the list of all target class object paths from the CIMOM. */
420 CMPIEnumeration * objectpaths = CBEnumInstanceNames(_BROKER, context, objectpath, &status);
421 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(objectpaths)) {
422 _SBLIM_TRACE(1,("--- CBEnumInstanceNames() failed - %s", CMGetCharPtr(status.msg)));
423 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot enumerate target class");
424 goto exit;
425 }
427 /* Return all object paths that exactly match the target class and resultClass, if specified. */
428 while (CMHasNext(objectpaths, NULL)) {
429 CMPIData data = CMGetNext(objectpaths, NULL);
430 char *class = CMGetCharPtr(CMGetClassName(data.value.ref, NULL));
432 if (CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL)) {
433 /* Create an instance for the association. */
434 CMPIInstance * refinstance = _CMNewInstance(_BROKER, namespace, _ASSOCCLASS, &status);
435 if ((status.rc != CMPI_RC_OK) || CMIsNullObject(refinstance)) {
436 _SBLIM_TRACE(1,("--- CMNewInstance() failed - %s", CMGetCharPtr(status.msg)));
437 CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR, "Cannot create new CMPIInstance");
438 goto exit;
439 }
441 /* Assign the references in the association appropriately. */
442 if (strcmp(sourceclass, _RHSCLASSNAME) == 0) {
443 CMSetProperty(refinstance, _RHSPROPERTYNAME, &reference, CMPI_ref);
444 CMSetProperty(refinstance, _LHSPROPERTYNAME, &data.value.ref, CMPI_ref);
445 } else {
446 CMSetProperty(refinstance, _RHSPROPERTYNAME, &data.value.ref, CMPI_ref);
447 CMSetProperty(refinstance, _LHSPROPERTYNAME, &reference, CMPI_ref);
448 }
450 CMReturnInstance(results, refinstance);
451 }
452 }
453 exit:
454 _SBLIM_RETURNSTATUS(status);
455 }
458 // ----------------------------------------------------------------------------
459 // AssociationInitialize()
460 // Perform any necessary initialization immediately after this provider is
461 // first loaded.
462 // ----------------------------------------------------------------------------
463 static void AssociationInitialize(
464 CMPIAssociationMI * self, /* [in] Handle to this provider (i.e. 'self'). */
465 const CMPIContext * context) /* [in] Additional context info, if any. */
466 {
467 _SBLIM_ENTER("AssociationInitialize");
468 _SBLIM_TRACE(2, ("--- self=\"%s\"", self->ft->miName));
469 // _SBLIM_TRACE(2, ("--- context=\"%s\"", CMGetCharPtr(CDToString(_BROKER, context, NULL))));
471 /* Nothing needs to be done to initialize this provider */
472 _SBLIM_RETURN();
473 }
476 // ============================================================================
477 // CMPI ASSOCIATION PROVIDER FUNCTION TABLE SETUP
478 // ============================================================================
479 CMAssociationMIStub( , Xen_MemoryAllocatedFromPool, _BROKER, AssociationInitialize(&mi, ctx));