[PATCH 0 of 2] #5 - SDC: Fixed type of returned instance and error code
by Heidi Eckhart
Patch 1: The returned RASD instances have been of the general classname ResourceAllocationSettingData instead of the type specific one, e.g. ProcResourceAllocationSettingData
Patch 2: RASD to AllocationCapabilities should return NOT_SUPPORTED instead of OK
Diff to #1:
patch 1: fixed missing check for unknown resource type
Diff to #2:
- added helper function to RASD that translates the resource type into the classname (patch 1 of 3)
- updated patch 2 (#1 before) to make use of the helper function
- updated patch 3 (#2 before) to make use of RETURN_UNSUPPORTED macro
Diff to #3:
- patch 1 and 3 are already checked in and no longer part of this patch series
- added patch to harden free_rasd_prop_list() function to handle NULL pointer
- patch 2 (also patch 2 before): cleaned up error handling
Diff to #4:
- patch 2: made inst_id a const char*
17 years
[PATCH] Change method arg type in VSMS AddResourceSettings
by lizg@cn.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1197876933 -28800
# Node ID 69bfac6904d4d863ebf20c88d700496790bee9a4
# Parent 72b93a4339e1c13080d6a6d80a580a7742c0b851
Change method arg type in VSMS AddResourceSettings
diff -r 72b93a4339e1 -r 69bfac6904d4 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Dec 14 10:37:01 2007 +0100
+++ b/src/Virt_VirtualSystemManagementService.c Mon Dec 17 15:35:33 2007 +0800
@@ -1076,7 +1076,7 @@ static struct method_handler AddResource
static struct method_handler AddResourceSettings = {
.name = "AddResourceSettings",
.handler = add_resource_settings,
- .args = {{"AffectedConfiguration", CMPI_string},
+ .args = {{"AffectedConfiguration", CMPI_ref},
{"ResourceSettings", CMPI_stringA},
ARG_END
}
17 years
[PATCH 0 of 4] #2 Fix NULL attributes returned by VSMigrationService.
by Kaitlin Rupert
Updates:
Add function to Virt_HostSystem that gets the values for the Name and CreationClassName attributes of the host instance.
Modify VSMgmtService so that it uses this function.
Get the values for the SystemName and SystemCreationClassName from the host instance and set accordingly.
17 years
Re: [Libvirt-cim] [PATCH 1 of 2] Fix VSMigrationService NULL key attributes
by Kaitlin Rupert
Kaitlin Rupert wrote:
> Dan Smith wrote:
>> My plan was never to remove the placeholder, but rather to modify the
>> placeholder with logic to look up and return the proper host system.
>> This would give us a control point for switching between host
>> instrumentation, with the option to keep our fake one if nothing else
>> is available.
>> Adding such a function seems like a good idea to me, and as long as it
>> uses the existing internal logic in HostSystem to get the information,
>> it shouldn't need to change later.
>>
>> Shall I hold off on this set or apply and let you add the generalized
>> function first?
>>
>> Thanks!
>>
>>
Yes, I'll rework this patch. No need to have the same code in multiple
places if we can avoid it. =)
--
Kaitlin Rupert
IBM Linux Technology Center
karupert(a)us.ibm.com
17 years
[PATCH 0 of 3] #3 - SDC: Fixed type of returned instance and error code
by Heidi Eckhart
Patch 1: The returned RASD instances have been of the general classname ResourceAllocationSettingData instead of the type specific one, e.g. ProcResourceAllocationSettingData
Patch 2: RASD to AllocationCapabilities should return NOT_SUPPORTED instead of OK
Diff to #1:
patch 1: fixed missing check for unknown resource type
Diff to #2:
- added helper function to RASD that translates the resource type into the classname (patch 1 of 3)
- updated patch 2 (#1 before) to make use of the helper function
- updated patch 3 (#2 before) to make use of RETURN_UNSUPPORTED macro
17 years
Failing query of AllocationCapabilities, GetInstance() does not return an instance
by Guo Lian Yun
The result of ein AllocationCapabilites is correct:
wbemcli ein
http://root:password@localhost:5988/root/virt:Xen_AllocationCapabilities
localhost:5988/root/virt:Xen_AllocationCapabilities.InstanceID="ProcessorPool/0"
localhost:5988/root/virt:Xen_AllocationCapabilities.InstanceID="MemoryPool/0"
localhost:5988/root/virt:Xen_AllocationCapabilities.InstanceID="DiskPool/foo"
localhost:5988/root/virt:Xen_AllocationCapabilities.InstanceID="NetworkPool/xenbr0"
localhost:5988/root/virt:Xen_AllocationCapabilities.InstanceID="NetworkPool/virbr0"
But failing qurey of gi AllocationCapabilities:
wbemcli gi
http://root:password@localhost:5988/root/virt:Xen_AllocationCapabilities...."ProcessorPool/0"
*
* wbemcli: Cim: (1) CIM_ERR_FAILED: A general error occurred that is not
covered by a more specific error code: "Could not get ResourceType."
*
Below is part of Virt_AllocationCapabilities provider's code:
static CMPIStatus GetInstance(CMPIInstanceMI *self,
const CMPIContext *context,
const CMPIResult *results,
const CMPIObjectPath *reference,
const char **properties)
{
return return_alloc_cap(reference, results, 0);
}
static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self,
const CMPIContext *context,
const CMPIResult *results,
const CMPIObjectPath *reference)
{
return alloc_cap_instances(_BROKER, reference, results, true,
NULL);
}
I think the causing issue it the same as
Xen_EnabledLogicalElementCapabilities provider.
Thanks!
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol(a)cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
17 years
[PATCH 0 of 2] #2 - SDC: Fixed type of returned instance and error code
by Heidi Eckhart
Patch 1: The returned RASD instances have been of the general classname ResourceAllocationSettingData instead of the type specific one, e.g. ProcResourceAllocationSettingData
Patch 2: RASD to AllocationCapabilities should return NOT_SUPPORTED instead of OK
Diff to #1:
patch 1: fixed missing check for unknown resource type
17 years
[PATCH] [CU] Merge do_ref() and do_assoc()
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197540659 -3600
# Node ID 0b30c3a70c3aa076d8aac5a6cf63af06413b056c
# Parent b5847180d00719ff39f2d451d4e79d4369952ad5
[CU] Merge do_ref() and do_assoc()
The two functions do_ref() and do_assoc() run through
the same logic. The only difference are the returned
instances. By configuring the do_assoc() function with
an additional paramter (ref_rslt) to inidcate the type
of the returned instance(s) - either reference(names) or
associator(names) - the two functions can be merged.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r b5847180d007 -r 0b30c3a70c3a std_association.c
--- a/std_association.c Fri Dec 07 17:15:07 2007 -0500
+++ b/std_association.c Thu Dec 13 11:10:59 2007 +0100
@@ -222,108 +222,111 @@ std_assoc_get_handler(const struct std_a
return NULL;
}
+static CMPIStatus prepare_ref_return_list(struct std_assoc *handler,
+ struct std_assoc_info *info,
+ const CMPIObjectPath *ref,
+ struct inst_list *list)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ struct inst_list tmp_list;
+ int i;
+
+ tmp_list = *list;
+ if (tmp_list.list == NULL)
+ return s;
+
+ inst_list_init(list);
+
+ for (i = 0; i < tmp_list.cur; i++) {
+ CMPIInstance *refinst;
+
+ refinst = handler->make_ref(ref, tmp_list.list[i], info, handler);
+ if (refinst == NULL)
+ continue;
+
+ inst_list_add(list, refinst);
+ }
+
+ inst_list_free(&tmp_list);
+ return s;
+}
+
+static CMPIStatus prepare_assoc_return_list(const CMPIBroker *broker,
+ struct std_assoc_info *info,
+ const CMPIObjectPath *ref,
+ struct inst_list *list)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (list->list == NULL)
+ return s;
+
+ s = filter_results(list,
+ NAMESPACE(ref),
+ info->result_class,
+ broker);
+
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("filter_results did not return CMPI_RC_OK.");
+ return s;
+ }
+
+ return s;
+}
+
static CMPIStatus do_assoc(struct std_assoc_ctx *ctx,
struct std_assoc_info *info,
const CMPIResult *results,
const CMPIObjectPath *ref,
+ bool ref_rslt,
bool names_only)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
struct inst_list list;
struct std_assoc *handler;
- inst_list_init(&list);
-
- CU_DEBUG("Getting handler...");
+ CU_DEBUG("Getting handler ...");
handler = std_assoc_get_handler(ctx, info, ref);
if (handler == NULL) {
CU_DEBUG("No handler found.");
- goto out;
+ return s;
}
CU_DEBUG("Getting handler succeeded.");
- CU_DEBUG("Calling handler->handler...");
+ inst_list_init(&list);
+
+ CU_DEBUG("Calling handler ...");
s = handler->handler(ref, info, &list);
-
if (s.rc != CMPI_RC_OK) {
CU_DEBUG("Handler did not return CMPI_RC_OK.");
goto out;
- } else {
- CU_DEBUG("Handler returned CMPI_RC_OK.");
- }
-
- if (list.list == NULL) {
- CU_DEBUG("List is empty.");
+ }
+ CU_DEBUG("Handler returned CMPI_RC_OK.");
+
+ /* References and ReferenceNames */
+ if (ref_rslt)
+ s = prepare_ref_return_list(handler,
+ info,
+ ref,
+ &list);
+ /* Associators and AssociatorNames */
+ else
+ s = prepare_assoc_return_list(ctx->brkr,
+ info,
+ ref,
+ &list);
+
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Prepare return list did not return CMPI_RC_OK.");
goto out;
}
-
- s = filter_results(&list,
- NAMESPACE(ref),
- info->result_class,
- ctx->brkr);
- if (s.rc != CMPI_RC_OK) {
- CU_DEBUG("filter_results did not return CMPI_RC_OK.");
- goto out;
- }
-
- if (list.list == NULL) {
- CU_DEBUG("List is empty.");
- goto out;
- } else {
- CU_DEBUG("Returned %u instance(s).", list.cur);
- }
+ CU_DEBUG("Returned %u instance(s).", list.cur);
if (names_only)
cu_return_instance_names(results, &list);
else
cu_return_instances(results, &list);
- out:
- inst_list_free(&list);
-
- return s;
-}
-
-static CMPIStatus do_ref(struct std_assoc_ctx *ctx,
- struct std_assoc_info *info,
- const CMPIResult *results,
- const CMPIObjectPath *ref,
- bool names_only)
-{
- CMPIStatus s = {CMPI_RC_OK, NULL};
- struct inst_list list;
- struct std_assoc *handler;
- int i;
-
- inst_list_init(&list);
-
- CU_DEBUG("Getting handler...");
- handler = std_assoc_get_handler(ctx, info, ref);
- if (handler == NULL) {
- CU_DEBUG("No handler found.");
- goto out;
- }
- CU_DEBUG("Getting handler succeeded.");
-
- CU_DEBUG("Calling handler->handler...");
- s = handler->handler(ref, info, &list);
- if ((s.rc != CMPI_RC_OK) || (list.list == NULL))
- goto out;
-
- for (i = 0; i < list.cur; i++) {
- CMPIInstance *refinst;
-
- refinst = handler->make_ref(ref, list.list[i], info, handler);
- if (refinst == NULL)
- continue;
-
- if (names_only)
- cu_return_instance_name(results, refinst);
- else
- CMReturnInstance(results, refinst);
- }
-
- CMSetStatus(&s, CMPI_RC_OK);
out:
inst_list_free(&list);
@@ -359,6 +362,7 @@ CMPIStatus stda_AssociatorNames(CMPIAsso
&info,
results,
reference,
+ false,
true);
}
@@ -386,6 +390,7 @@ CMPIStatus stda_Associators(CMPIAssociat
&info,
results,
reference,
+ false,
false);
}
@@ -406,7 +411,12 @@ CMPIStatus stda_ReferenceNames(CMPIAssoc
self->ft->miName,
};
- return do_ref(self->hdl, &info, results, reference, true);
+ return do_assoc(self->hdl,
+ &info,
+ results,
+ reference,
+ true,
+ true);
}
CMPIStatus stda_References(CMPIAssociationMI *self,
@@ -427,7 +437,12 @@ CMPIStatus stda_References(CMPIAssociati
self->ft->miName,
};
- return do_ref(self->hdl, &info, results, reference, false);
+ return do_assoc(self->hdl,
+ &info,
+ results,
+ reference,
+ true,
+ false);
}
/*
17 years
Failing query of gi of Xen_VirtualSystemMigrationCapabilities and Xen_VirtualSystemMigrationService in sfcb
by Guo Lian Yun
Hi,
I can get excepted results by ein Xen_VirtualSystemMigrationCapabilities
and Xen_VirtualSystemMigrationService in sfcb:
wbemcli ein
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationC...
localhost:5988/root/virt:Xen_VirtualSystemMigrationCapabilities.InstanceID="MigrationCapabilities"
wbemcli ein
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationS...
localhost:5988/root/virt:Xen_VirtualSystemMigrationService.SystemCreationClassName="",SystemName="",CreationClassName="Xen_VirtualSystemMigrationService",Name="MigrationService"
But the query of gi of them are failing as followings:
wbemcli gi
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationC...
"MigrationCapabilities"
*
* wbemcli: Http Exception: server returned nothing (no headers, no data)
*
wbemcli gi
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationS...
"Xen_VirtualSystemMigrationService",Name="MigrationService",SystemCreationClassName="",SystemName=""
*
* wbemcli: Cim: (1) CIM_ERR_FAILED: *** Provider
Virt_VSMigrationService(17139) exiting due to a SIGSEGV signal
*
However, whatever ein or gi, the test results are correct in Pegasus, below
is the test report:
wbemcli ein
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationC...
localhost:5988/root/virt:Xen_VirtualSystemMigrationCapabilities.InstanceID="MigrationCapabilities"
wbemcli ein
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigraktion...
localhost:5988/root/virt:Xen_VirtualSystemMigrationService.CreationClassName="Xen_VirtualSystemMigrationService",Name="MigrationService",SystemCreationClassName="",SystemName=""
wbemcli gi
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationC...
"MigrationCapabilities"
localhost:5988/root/virt:Xen_VirtualSystemMigrationCapabilities.InstanceID="MigrationCapabilities"
Caption,Description,InstanceID="MigrationCapabilities",ElementName,DestinationHostFormatsSupported,SynchronousMethodsSupported,AsynchronousMethodsSupported,CreationClassName="Xen_VirtualSystemMigrationCapabilities"
wbemcli gi
http://root:password@localhost:5988/root/virt:Xen_VirtualSystemMigrationS...
"Xen_VirtualSystemMigrationService",Name="MigrationService",SystemCreationClassName="",SystemName=""
localhost:5988/root/virt:Xen_VirtualSystemMigrationService.CreationClassName="Xen_VirtualSystemMigrationService",Name="MigrationService",SystemCreationClassName="",SystemName=""
Caption,Description,ElementName,InstallDate,OperationalStatus,StatusDescriptions,Status,HealthState,PrimaryStatus,DetailedStatus,OperatingStatus,CommunicationStatus,EnabledState=5,OtherEnabledState,RequestedState=12,EnabledDefault=2,TimeOfLastStateChange,AvailableRequestedStates,TransitioningToState=12,SystemCreationClassName,SystemName,CreationClassName="Xen_VirtualSystemMigrationService",Name="MigrationService",PrimaryOwnerName,PrimaryOwnerContact,StartMode,Started
Kaitlin said the fix of NULL key value has been in her list. Does the
failure related with the NULL value of some keys, then why it can be test
successfully on Pegasus?
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol(a)cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
17 years