[Libvirt-cim] [PATCH] Added installation support for openWbem

Heidi Eckhart heidieck at linux.vnet.ibm.com
Tue Dec 18 11:38:42 UTC 2007


# HG changeset patch
# User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
# Date 1197979046 -3600
# Node ID 65312624c9db0b41ec81ccb81a37274cf6901996
# Parent  7dde77938c45866d0200d647d312407118abdc1a
Added installation support for openWbem
Signed-off-by: Heidi Eckhart <heidieck at 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




More information about the Libvirt-cim mailing list