[PATCH 0 of 2] [RFC] Prepare provider registration and provider name for OpenWbem
by Heidi Eckhart
To enable the libvirt-cim providers for registration and work with OpenWbem
it is necessary to update the mof files with an additional "Provider" qualifier
and slightly change the provider name.
patch 1: updated the mof files with the additional "Provider" qualifier. The syntax is "<provider interface>:<module name>". For our providers this means "cmpi:<filename>", e.g. "cmpi:Virt_HostSystem"
patch 2: the registration for OpenWbem requires an entry point <modulename>_Create_InstanceMI, which means that the filename and the providername have to become the same. This is necessary to let STD_InstanceMIStub correctly create the right CMPI entry points.
I have tested this setup with sfcb, Pegasus and OpenWbem and it worked for all. If no one encounteres issues with this slighly changed provider naming, I will create patches for all providers. If someone has a hard requirement to name the provider different compared to the file, please raise your hand ;). I look forward an interesting discussion.
17 years
[PATCH] Remove error message of trailing backslash in src/Makefile.am
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1198059368 -3600
# Node ID 133cbb1df893f2d031cba3534c88936bce69da78
# Parent 615554f6eca4cd21e5715a3af73a616637e54f96
Remove error message of trailing backslash in src/Makefile.am
Running libtool ...
Running aclocal ...
Running autoheader ...
Running automake ...
src/Makefile.am:17: whitespace following trailing backslash
Running autoconf ...
You may now run ./configure
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 615554f6eca4 -r 133cbb1df893 src/Makefile.am
--- a/src/Makefile.am Fri Dec 14 16:13:18 2007 -0800
+++ b/src/Makefile.am Wed Dec 19 11:16:08 2007 +0100
@@ -14,7 +14,7 @@ noinst_HEADERS = profiles.h svpc_types.h
Virt_SettingsDefineCapabilities.h \
Virt_VirtualSystemManagementCapabilities.h \
Virt_VirtualSystemManagementService.h \
- Virt_VSSD.h \
+ Virt_VSSD.h \
Virt_VSMigrationCapabilities.h \
Virt_VSMigrationService.h
17 years
[PATCH] if statement in state_change() in CS expects incorrect return value
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1197946011 28800
# Node ID 6f5ab2a959deeb6e13e8f684a014bec9fda36032
# Parent 8d761c7477e78302fb7dfea2ac6d82cc58974dd5
if statement in state_change() in CS expects incorrect return value.
cu_get_u16_arg() returns CMPI_RC_OK upon success.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 8d761c7477e7 -r 6f5ab2a959de src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Fri Dec 14 16:13:18 2007 -0800
+++ b/src/Virt_ComputerSystem.c Mon Dec 17 18:46:51 2007 -0800
@@ -662,7 +662,7 @@ static CMPIStatus state_change(CMPIMetho
const char *name = NULL;
ret = cu_get_u16_arg(argsin, "RequestedState", &state);
- if (!ret) {
+ if (ret != CMPI_RC_OK) {
CMSetStatus(&s, CMPI_RC_ERR_INVALID_PARAMETER);
goto out;
}
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 1197944392 -28800
# Node ID 58868e43ae199187436f1709da9177e4fa0a8f3d
# Parent 72b93a4339e1c13080d6a6d80a580a7742c0b851
Change method arg type in VSMS AddResourceSettings
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r 72b93a4339e1 -r 58868e43ae19 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Dec 14 10:37:01 2007 +0100
+++ b/src/Virt_VirtualSystemManagementService.c Tue Dec 18 10:19:52 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 3] #2 Fix AC GetInstance() error
by Kaitlin Rupert
Update: sfcb seg faults if no instance is found but the provider returns a success. Add a fix so that if an instance isn't found, and error is returned.
AC GetInstance() currently returns an error. This patchset fixes that error and also cleans up some left over functions.
17 years
[PATCH] Added installation support for openWbem
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197979046 -3600
# Node ID 65312624c9db0b41ec81ccb81a37274cf6901996
# Parent 7dde77938c45866d0200d647d312407118abdc1a
Added installation support for openWbem
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 7dde77938c45 -r 65312624c9db base_schema/install_base_schema.sh.in
--- a/base_schema/install_base_schema.sh.in Tue Dec 18 10:19:52 2007 +0800
+++ b/base_schema/install_base_schema.sh.in Tue Dec 18 12:57:26 2007 +0100
@@ -3,6 +3,7 @@ DATA="$1"
DATA="$1"
NS=@CIM_VIRT_NS@
CIMOM=@CIMSERVER@
+SCHEMA_VERSION="2.16"
TMPDIR=$(mktemp -d /tmp/cim_schema.XXXXX)
@@ -44,6 +45,17 @@ detect_sfcb_dir() {
done
}
+detect_openwbem_dir() {
+ dirs="/usr/share/mof"
+
+ for d in $dirs; do
+ if [ -d "$d" ]; then
+ echo $d
+ return
+ fi
+ done
+}
+
install_schema_pegasus() {
local repo=$(detect_peg_repo)
@@ -76,6 +88,26 @@ install_schema_sfcb() {
sfcbrepos -f
}
+install_schema_openwbem() {
+ local dir=$(detect_openwbem_dir)
+ local schema_dir=$dir/cimv$SCHEMA_VERSION
+
+ mkdir $schema_dir
+ if [ -d "$schema_dir" ]; then
+ echo "Unable to determine openwbem schema directory"
+ return
+ fi
+
+ cp ${TMPDIR}/cimv???.mof ${TMPDIR}/CIM_Schema.mof
+ cp -ra ${TMPDIR}/* $schema_dir
+
+ owcreatenamespace -u http://localhost/ -n root/virt
+ owmofc -u http://localhost/cimom -n root/virt $schema_dir/CIM_Schema.mof
+
+ owcreatenamespace -u http://localhost/ -n root/interop
+ owmofc -u http://localhost/cimom -n root/interop $schema_dir/cimv???-interop.mof
+}
+
if [ -z "$1" ]; then
echo "Usage: $0 [source_dir]"
exit 1
@@ -91,6 +123,9 @@ case "$CIMOM" in
pegasus)
(install_schema_pegasus) >>$DEBUG 2>&1
;;
+ openwbem)
+ (install_schema_openwbem) >>$DEBUG 2>&1
+ ;;
*)
echo ERROR: Unknown CIMOM: $CIMOM
;;
diff -r 7dde77938c45 -r 65312624c9db provider-register.sh
--- a/provider-register.sh Tue Dec 18 10:19:52 2007 +0800
+++ b/provider-register.sh Tue Dec 18 12:57:26 2007 +0100
@@ -497,6 +497,9 @@ openwbem_repository()
openwbem_install()
{
+ namespace=$1
+ shift
+
CIMMOF=`which owmofc 2> /dev/null`
if test $? != 0
then
@@ -531,7 +534,7 @@ openwbem_install()
if openwbem_transform $_REGFILENAME $*
then
chatter Registering providers with $state owcimomd
- $CIMMOF $_REGFILENAME > /dev/null
+ $CIMMOF -u http://localhost/cimom -n $namespace $_REGFILENAME > /dev/null
else
echo "Failed to build OpenWBEM registration MOF." >&2
return 1
@@ -540,6 +543,9 @@ openwbem_install()
openwbem_uninstall()
{
+ namespace=$1
+ shift
+
CIMMOF=`which owmofc 2> /dev/null`
if test $? != 0
then
@@ -728,7 +734,7 @@ then
case $cimserver in
pegasus) pegasus_install $namespace $mofs ":" $regs;;
sfcb) sfcb_install $namespace $mofs ":" $regs;;
- openwbem) openwbem_install $mofs ;;
+ openwbem) openwbem_install $namespace $mofs ;;
sniacimom) echo sniacimom not yet supported && exit 1 ;;
**) echo "Invalid CIM Server Type " $cimserver && exit 1;;
esac
@@ -736,7 +742,7 @@ else
case $cimserver in
pegasus) pegasus_uninstall $namespace $mofs ":" $regs;;
sfcb) sfcb_uninstall $namespace $mofs ":" $regs;;
- openwbem) openwbem_uninstall $mofs ;;
+ openwbem) openwbem_uninstall $namespace $mofs ;;
sniacimom) echo sniacimom not yet supported && exit 1 ;;
**) echo "Invalid CIM Server Type " $cimserver && exit 1;;
esac
17 years
[PATCH 0 of 2] #4 - 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
17 years