VSMS method args type
by Zhengang Li
Dan,
I got this when writing the resource setting data related method test
case for VSMS.
In DMTF cimv216Experimental, we have:
uint32 AddResourceSettings(CIM_VSSD REF AffectedConfiguration,
string ResourceSettings[],
CIM_RASD REF ResultingResourceSettings[], /* out */
CIM_ConcreteJob REF Job); /* out */
uint32 RemoveResourceSettings(CIM_RASD REF ResourceSettings[],
CIM_ConcreteJob REF Job); /* out */
But in the VSMS provider, the handlers are defined as follows:
static struct method_handler AddResourceSettings = {
.name = "AddResourceSettings",
.handler = add_resource_settings,
.args = {{"AffectedConfiguration", CMPI_string}, /* dmtf
mof says CMPI_ref here */
{"ResourceSettings", CMPI_stringA},
ARG_END
}
};
static struct method_handler RemoveResourceSettings = {
.name = "RemoveResourceSettings",
.handler = rm_resource_settings,
.args = {{"ResourceSettings", CMPI_stringA}, /* dmtf mof
says CMPI_refA here */
ARG_END
}
};
And the three add/modify/remove resource settings method handler are
using the same
helper function 'update_resource_settings' taking ResourceSettings as
embedded instance
string array.
I think we need some code refactoring here for the three method handlers.
--
- Zhengang
17 years
sfcb: Internal Provider SIGSEGV
by Jay Gagnon
I have encountered a situation that causes a segfault in sfcb's internal
provider. I am writing an indication provider, and using a fairly
simple python script that sets up a filter, a handler, and a
subscription to monitor my indication. This works fine. The problem
occurs when I try to unsubscribe. My indication is deactivated, but as
this is happening I see the segfault. I found this problem while
running 1.2.4, so I tested with the current cvs head and got identical
results.
Here is the stdout from sfcbd, run with no arguments.
root@halga /usr/include/cmpi # sfcbd
--- sfcbd V1.3preview started - 29864
--- Using /usr/local/etc/sfcb/sfcb.cfg
--- SSL not configured
--- User authentication disabled
--- Max provider procs: 32
--- initSocketPairs: 64
--- Max Http procs: 8
--- sfcbd HTTP Daemon V1.3preview started - 29866 - port 5988
--- Keep-alive timeout: 1 seconds
--- Maximum requests per connection: 10
--- localConnectServer started
--- Caching ClassProvider for
/usr/local/var/lib/sfcb/registration/repository/root/virt/classSchemas
(1.0-3) using 3584 bytes
--- Caching ClassProvider for
/usr/local/var/lib/sfcb/registration/repository/root/interop/classSchemas
(1.0-3) using 1092 bytes
Virt_ComputerSystemModifiedIndication.c(213): ActivateFilter
Virt_ComputerSystemModifiedIndication.c(213): ActivateFilter
Virt_ComputerSystemModifiedIndication.c(244):
ComputerSystemModifiedIndication enabled
Virt_ComputerSystemModifiedIndication.c(186): entering event loop
Virt_ComputerSystemModifiedIndication.c(256):
ComputerSystemModifiedIndication disabled
-#- InternalProvider - 29876 provider exiting due to a SIGSEGV signal
Virt_ComputerSystemModifiedIndication.c(201): exiting event loop
All of the "Virt_ComputerSystemModifiedIndication.c(foo): ..." lines are
debug lines from my provider. It seems to be receiving the deactivation
correctly from sfcb, but the segfault causes the subscription, handler,
and filter to not be removed correctly. Generally, I have to run
"killall -9 sfcbd && sfcbrepos" to get things back to a working state.
The indication provider itself is not doing anything complicated. It
just sets up a simple event loop that doesn't do much of anything other
than wait to be deactivated.
Now for the XML that our python script uses to set up and tear down the
filter, handler, and subscription. My apologies for the length. I
grouped the creates with their respective deletes for ease of
comparison; the order we actually run them in is CreateFilter,
CreateHandler, CreateSubscription, then DeleteSubscription,
DeleteHandler, DeleteFilter.
CreateFilter:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationFilter">
<PROPERTY NAME="SystemCreationClassName" TYPE="string">
<VALUE>CIM_ComputerSystem</VALUE>
</PROPERTY>
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
<PROPERTY NAME="CreationClassName" TYPE="string">
<VALUE>CIM_IndicationFilter</VALUE>
</PROPERTY>
<PROPERTY NAME="Name" TYPE="string">
<VALUE>TestFilter</VALUE>
</PROPERTY>
<PROPERTY NAME="Query" TYPE="string">
<VALUE> SELECT * FROM CIM_InstModification
</VALUE>
</PROPERTY>
<PROPERTY NAME="QueryLanguage" TYPE="string">
<VALUE>WQL</VALUE>
</PROPERTY>
<PROPERTY NAME="SourceNamespace" TYPE="string">
<VALUE>root/virt</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
DeleteFilter:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_IndicationFilterCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE>localhost.localdomain</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE>CIM_IndicationFilterCIMXML</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>TestFilter</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>;
CreateHandler:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationHandlerCIMXML">
<PROPERTY NAME="SystemCreationClassName" TYPE="string">
<VALUE>CIM_ComputerSystem</VALUE>
</PROPERTY>
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
<PROPERTY NAME="CreationClassName" TYPE="string">
<VALUE>CIM_IndicationHandlerCIMXML</VALUE>
</PROPERTY>
<PROPERTY NAME="Name" TYPE="string">
<VALUE>TestHandler</VALUE>
</PROPERTY>
<PROPERTY NAME="Destination" TYPE="string">
<VALUE>localhost:8000</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
DeleteHandler:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_IndicationHandlerCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE>localhost.localdomain</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE>CIM_IndicationHandlerCIMXML</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>TestHandler</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>;
CreateSubscription:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationSubscription">
<PROPERTY.REFERENCE NAME="Filter"
REFERENCECLASS="CIM_IndicationFilter">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="CIM_IndicationFilter">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationFilter
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestFilter
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</PROPERTY.REFERENCE>
<PROPERTY.REFERENCE NAME="Handler"
REFERENCECLASS="CIM_IndicationHandler">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="CIM_IndicationHandlerCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationHandlerCIMXML
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestHandler
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</PROPERTY.REFERENCE>
<PROPERTY NAME="SubscriptionState" TYPE="uint16">
<VALUE> 2 </VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
DeleteSubscription:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_IndicationSubscription">
<KEYBINDING NAME="Filter">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="CIM_IndicationFilter">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationFilter
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestFilter
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</KEYBINDING>
<KEYBINDING NAME="Handler">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="CIM_IndicationHandlerCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationHandlerCIMXML
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestHandler
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>;
Thanks!
--
-Jay
17 years
[PATCH] Fix SDC - AllocationCapabilities - RASD returns error
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1197322131 28800
# Node ID 6fdfdb1a22c5f790cfd08538a3e29923ccd2237c
# Parent 70e9f11ed6d3ea63b342c4c3de68cc948d7c1cfd
Fix SDC - AllocationCapabilities - RASD returns error.
Querying SDC using an AllocationCapabilities instance returns: "Could not get ResourceType". This is because SDC is expecting the AC ref to have the ResourceType defined. But ResourceType isn't a key, so SDC can be queried without specifying a value for ResourceType.
Instead of using the ResourceType attribute, get the resource type from the InstanceID.
Failing query:
wbemcli ai -ac Xen_SettingsDefineCapabilities 'http://root:elm3b41@localhost:5988/root/virt:Xen_AllocationCapabilities.I..."ProcessorPool/0"'
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 70e9f11ed6d3 -r 6fdfdb1a22c5 src/Makefile.am
--- a/src/Makefile.am Mon Dec 10 08:54:08 2007 -0800
+++ b/src/Makefile.am Mon Dec 10 13:28:51 2007 -0800
@@ -102,9 +102,9 @@ libVirt_AllocationCapabilities_la_SOURCE
libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c
libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool
-libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la
+libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_Device.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
-libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool
+libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool -lVirt_Device
libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c
@@ -146,4 +146,4 @@ libVirt_ElementSettingData_la_LIBADD = -
libVirt_VSMigrationCapabilities_la_SOURCES = Virt_VSMigrationCapabilities.c
-libVirt_VSMigrationService_la_SOURCES = Virt_VSMigrationService.c
\ No newline at end of file
+libVirt_VSMigrationService_la_SOURCES = Virt_VSMigrationService.c
diff -r 70e9f11ed6d3 -r 6fdfdb1a22c5 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Mon Dec 10 08:54:08 2007 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Mon Dec 10 13:28:51 2007 -0800
@@ -42,6 +42,7 @@
#include "Virt_SettingsDefineCapabilities.h"
#include "Virt_DevicePool.h"
+#include "Virt_Device.h"
const static CMPIBroker *_BROKER;
@@ -778,23 +779,31 @@ static CMPIStatus alloc_cap_to_rasd(cons
struct inst_list *list)
{
CMPIStatus s = {CMPI_RC_OK};
- int ret;
uint16_t type;
+ const char *id = NULL;
if (!match_hypervisor_prefix(ref, info))
return s;
CU_DEBUG("Getting ResourceType");
- ret = cu_get_u16_path(ref, "ResourceType", &type);
- if (ret != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Could not get ResourceType");
- goto out;
- }
-
+ if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing InstanceID");
+ goto out;
+ }
+
+ type = device_type_from_classname(id);
+
CU_DEBUG("ResourceType: %hi", type);
+
+ if (type == VIRT_DEV_UNKNOWN) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to determine resource type");
+ goto out;
+ }
s = sdc_rasds_for_type(ref, list, type);
17 years
[PATCH 0 of 2] Add migration job support
by Dan Smith
This set adds job support to migration, so that the migration methods
return immediately with a job reference. The progress of the migration
can be monitored by looking at Virt_MigrationJob instances.
I left a good opening for indications (which will be necessary) by adding
the migrate_job_set_state() function. This updates the state of the
persistent job, which would be time(s) when we're looking to send an
indication.
Right now, Jobs are left in the persistent store after they're complete.
Comments about the best policy for handling this are welcome. I know that
I should be able to put a lifetime on them so they expire after completion,
but I'm not sure if that's something that should be left to the client.
17 years
[PATCH] [CU] Fix tools/Makefile to take care of removed itest.c
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197275636 -3600
# Node ID 232cec89a48eab8ef8e597a7e90334cb6c50987c
# Parent d09a2f8d14bf7fb9e78480353cb18c54545b9d1d
[CU] Fix tools/Makefile to take care of removed itest.c
The itest.c file was removed by the previous fix, but
not taken out of tools/Makefile.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r d09a2f8d14bf -r 232cec89a48e tools/Makefile.am
--- a/tools/Makefile.am Thu Dec 06 11:36:42 2007 -0500
+++ b/tools/Makefile.am Mon Dec 10 09:33:56 2007 +0100
@@ -1,4 +1,1 @@
# Copyright IBM Corp. 2007
-noinst_PROGRAMS = itest
-
-itest_SOURCES = itest.c
\ No newline at end of file
17 years
[PATCH 0 of 5] Build and configure cleanups
by Dan Smith
This patch set started out as just a change to check for a new-enough
version of libvirt on the installed system. It evolved into cleaning up
a bunch of the package checks in aclocal.m4, a couple of configure
cleanups, and a bunch of changes #include statements to account for
changes in how we include package directories (which is correct, as of
this set, IMHO).
Comments and testing on a variety of platforms would be appreciated.
17 years
[PATCH] html: Added additional classes to cimv216-interop.mof
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196935599 -3600
# Node ID 30269254841ceed6a250ea2b714c594fa30cc19e
# Parent ba4bc35f508573c53e4303ce2e7a9b5299b95f38
html: Added additional classes to cimv216-interop.mof
These additional classes are necessary to register Xen/KVM
ComputerSystem and HostSystem classes to interop. Otherwise
Pegasus refuses the registration.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r ba4bc35f5085 -r 30269254841c doc/libvirt-cim.html
--- a/doc/libvirt-cim.html Thu Dec 06 11:06:38 2007 +0100
+++ b/doc/libvirt-cim.html Thu Dec 06 11:06:39 2007 +0100
@@ -300,6 +300,11 @@ below:</p>
#pragma include ("qualifiers.mof")<br/>
#pragma include ("qualifiers_optional.mof")<br/>
#pragma include ("Core/CIM_ManagedElement.mof")<br/>
+#pragma include ("Core/CIM_ManagedSystemElement.mof")<br/>
+#pragma include ("Core/CIM_LogicalElement.mof")<br/>
+#pragma include ("Core/CIM_EnabledLogicalElement.mof")<br/>
+#pragma include ("Core/CIM_System.mof")<br/>
+#pragma include ("System/CIM_ComputerSystem.mof")<br/>
#pragma include ("Interop/CIM_RegisteredProfile.mof")<br/>
#pragma include ("Interop/CIM_RegisteredSubProfile.mof")<br/>
#pragma include ("Core/CIM_Dependency.mof")<br/>
17 years