[PATCH] Add installation instructions for root/interop namespace
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1195206999 -3600
# Node ID 15cc86eee7e50fb5b6dd648d519013327b8e8c57
# Parent c9e977e820e99070f0c0c0397061229f7382ac7b
Add installation instructions for root/interop namespace
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r c9e977e820e9 -r 15cc86eee7e5 doc/libvirt-cim.html
--- a/doc/libvirt-cim.html Wed Nov 14 13:06:06 2007 +0100
+++ b/doc/libvirt-cim.html Fri Nov 16 10:56:39 2007 +0100
@@ -76,6 +76,7 @@
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof<br/>
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof<br/>
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof<br/>
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<<br/>
</code></p>
<h4>To install the schema in SFCB:</h4>
@@ -111,6 +112,23 @@
+//#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")<br/>
+//#pragma include ("Security/CIM_IPPacketFilterIndication.mof")<br/>
#pragma include ("Support/PRS_ActivityContact.mof")<br/>
+</code></p>
+
+<p><strong>cimv216-interop.mof</strong> is not part of the official DMTF
+ CIM v2.16 schema package. Please create with the folloing content:
+</p>
+
+<p><code>
+#pragma locale ("en_US")<br/>
+#pragma include ("qualifiers.mof")<br/>
+#pragma include ("qualifiers_optional.mof")<br/>
+#pragma include ("Core/CIM_ManagedElement.mof")<br/>
+#pragma include ("Interop/CIM_RegisteredProfile.mof")<br/>
+#pragma include ("Interop/CIM_RegisteredSubProfile.mof")<br/>
+#pragma include ("Core/CIM_Dependency.mof")<br/>
+#pragma include ("Interop/CIM_ElementConformsToProfile.mof")<br/>
+#pragma include ("Interop/CIM_ReferencedProfile.mof")<br/>
+#pragma include ("Interop/CIM_SubProfileRequiresProfile.mof")<br/>
</code></p>
<h2><a name="Platforms">Platform Support</a></h2>
17 years, 1 month
[PATCH] Add new function cu_copy_prop, which copies a property from one instance to another
by Dan Smith
This is Jay's cu_copy_prop() function, which I got privately and
forgot to put in the tree before his patch that uses it. I'm going to
commit it now.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1195502361 18000
# Node ID 805e9c0e7a9d3c7c6fe4e4f9546f48df5bd6c372
# Parent d6f1b6d1296bbe43c4edcc35475a05eef570e806
Add new function cu_copy_prop, which copies a property from one instance to another.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r d6f1b6d1296b -r 805e9c0e7a9d instance_util.c
--- a/instance_util.c Thu Nov 15 13:07:50 2007 -0800
+++ b/instance_util.c Mon Nov 19 14:59:21 2007 -0500
@@ -156,6 +156,37 @@ const char *cu_compare_ref(const CMPIObj
prop = NULL;
out:
return prop;
+}
+
+CMPIStatus cu_copy_prop(const CMPIBroker *broker,
+ CMPIInstance *src_inst, CMPIInstance *dest_inst,
+ char *src_name, char *dest_name)
+{
+ CMPIData data;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (src_name == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "No property name given");
+ goto out;
+ }
+
+ if (dest_name == NULL)
+ dest_name = src_name;
+
+ data = CMGetProperty(src_inst, src_name, &s);
+ if (s.rc != CMPI_RC_OK || CMIsNullValue(data)) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Copy failed. Could not get prop '%s'.", src_name);
+ goto out;
+ }
+
+ CMSetProperty(dest_inst, dest_name, &(data.value), data.type);
+
+ out:
+ return s;
}
/*
diff -r d6f1b6d1296b -r 805e9c0e7a9d libcmpiutil.h
--- a/libcmpiutil.h Thu Nov 15 13:07:50 2007 -0800
+++ b/libcmpiutil.h Mon Nov 19 14:59:21 2007 -0500
@@ -61,6 +61,20 @@
* If set to anything else, uses value as name of log file to fprintf to.
*/
void debug_print(char *fmt, ...);
+
+/**
+ * Copies a property from one CMPIInstance to another. If dest_name is NULL,
+ * it is assumed to be the same as src_name.
+ *
+ * @param broker CIM broker, needed for status calls
+ * @param src_inst Instance to copy from
+ * @param dest_inst Instance to copy to
+ * @param src_name Name of property to be copied from src_inst
+ * @param dest_name Name of property to be copied to dest_inst
+ */
+CMPIStatus cu_copy_prop(const CMPIBroker *broker,
+ CMPIInstance *src_inst, CMPIInstance *dest_inst,
+ char *src_name, char *dest_name);
/**
* Check arguments (names and count)
17 years, 1 month
[PATCH] More rpm changes, per Fedora package review process
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1195572986 28800
# Node ID 820db60ea59d76e6fc2080ba3f2851415191fc76
# Parent f2c751be5069df9eb23a8bdbaafd5d55b3fd24e9
More rpm changes, per Fedora package review process
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r f2c751be5069 -r 820db60ea59d libcmpiutil.spec.in
--- a/libcmpiutil.spec.in Mon Nov 19 12:57:42 2007 -0800
+++ b/libcmpiutil.spec.in Tue Nov 20 07:36:26 2007 -0800
@@ -4,7 +4,7 @@ Name: libcmpiutil
Name: libcmpiutil
Version: @PACKAGE_VERSION@
Release: 1%{?dist}%{?extra_release}
-License: LGPL
+License: LGPLv2+
Group: Development/Libraries
Source: libcmpiutil-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -26,6 +26,7 @@ Group: Development/Libraries
Group: Development/Libraries
Requires: tog-pegasus-devel
Requires: pkgconfig
+Requires: %{name} = %{version}-%{release}
%description devel
Includes and documentations for the CMPI utility library
@@ -36,42 +37,41 @@ instance properties to standardizing met
%prep
%setup -q
+chmod -x *.c *.y *.h *.l
%build
%configure
-make
+make %{?_smp_mflags}
%install
-rm -fr %{buildroot}
+rm -fr $RPM_BUILD_ROOT
-%makeinstall
+make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
%clean
-rm -fr %{buildroot}
+rm -fr $RPM_BUILD_ROOT
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
-%postun
-/sbin/ldconfig
+%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
-%doc doc/doxygen.conf doc/mainpage doc/SubmittingPatches README
+%doc doc/doxygen.conf doc/mainpage README
%{_libdir}/lib*.so.*
%files devel
%defattr(-, root, root)
%{_libdir}/lib*.so
-%dir %{_includedir}/
+%dir %{_includedir}/libcmpiutil
%{_includedir}/libcmpiutil/*.h
%{_libdir}/pkgconfig/libcmpiutil.pc
-%doc doc/doxygen.conf doc/mainpage doc/SubmittingPatches README
+%doc doc/SubmittingPatches
%changelog
* Fri Oct 26 2007 Daniel Veillard <veillard(a)redhat.com> - 0.1-1
17 years, 1 month
[PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1195593960 18000
# Node ID 0d019645db934b886b71a744c12a83ce5034e7e2
# Parent 2e1dc075f0a9996bfdd2f437928d261081c1f9d6
Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work.
This should include all the suggestions from the first iteration, and the missing virConnectClose from the second.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 2e1dc075f0a9 -r 0d019645db93 src/Makefile.am
--- a/src/Makefile.am Tue Nov 20 14:56:34 2007 -0500
+++ b/src/Makefile.am Tue Nov 20 16:26:00 2007 -0500
@@ -91,9 +91,9 @@ libVirt_ElementCapabilities_la_LIBADD =
-lVirt_ComputerSystem \
-lVirt_HostSystem
-libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la
+libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la
libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c
-libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD
+libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool
libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
diff -r 2e1dc075f0a9 -r 0d019645db93 src/Virt_AllocationCapabilities.c
--- a/src/Virt_AllocationCapabilities.c Tue Nov 20 14:56:34 2007 -0500
+++ b/src/Virt_AllocationCapabilities.c Tue Nov 20 16:26:00 2007 -0500
@@ -32,6 +32,7 @@
#include "Virt_AllocationCapabilities.h"
#include "Virt_RASD.h"
+#include "Virt_DevicePool.h"
const static CMPIBroker *_BROKER;
@@ -85,6 +86,101 @@ static CMPIStatus return_alloc_cap(const
else
CMReturnInstance(results, inst);
out:
+ return s;
+}
+
+static CMPIStatus ac_from_pool(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ CMPIInstance *pool,
+ CMPIInstance **alloc_cap)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ *alloc_cap = get_typed_instance(broker,
+ CLASSNAME(ref),
+ "AllocationCapabilities",
+ NAMESPACE(ref));
+ if (*alloc_cap == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get alloc_cap instance");
+ goto out;
+ }
+
+ s = cu_copy_prop(broker, pool, *alloc_cap, "InstanceID", NULL);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Error copying InstanceID");
+ goto out;
+ }
+
+ s = cu_copy_prop(broker, pool, *alloc_cap, "ResourceType", NULL);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Error copying InstanceID");
+ goto out;
+ }
+ out:
+ return s;
+}
+
+static CMPIStatus alloc_cap_instances(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ const CMPIResult *results,
+ bool names_only,
+ const char **properties)
+{
+ int i;
+ virConnectPtr conn = NULL;
+ CMPIInstance *alloc_cap_inst;
+ struct inst_list alloc_cap_list;
+ struct inst_list device_pool_list;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ CU_DEBUG("In alloc_cap_instances()");
+
+ inst_list_init(&device_pool_list);
+ inst_list_init(&alloc_cap_list);
+
+ if (!provider_is_responsible(broker, ref, &s))
+ goto out;
+
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
+ if (conn == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not connect to hypervisor");
+ goto out;
+ }
+
+ s = get_all_pools(broker, conn, NAMESPACE(ref), &device_pool_list);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Error fetching device pools");
+ goto out;
+ }
+
+ for (i = 0; i < device_pool_list.cur; i++) {
+ s = ac_from_pool(broker, ref,
+ device_pool_list.list[i],
+ &alloc_cap_inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ inst_list_add(&alloc_cap_list, alloc_cap_inst);
+ }
+
+ if (names_only)
+ cu_return_instance_names(results, &alloc_cap_list);
+ else
+ cu_return_instances(results, &alloc_cap_list);
+
+ out:
+ virConnectClose(conn);
+ inst_list_free(&alloc_cap_list);
+ inst_list_free(&device_pool_list);
return s;
}
@@ -97,8 +193,23 @@ static CMPIStatus GetInstance(CMPIInstan
return return_alloc_cap(reference, results, 0);
}
-DEFAULT_EI();
-DEFAULT_EIN();
+static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference)
+{
+ return alloc_cap_instances(_BROKER, reference, results, true, NULL);
+}
+
+static CMPIStatus EnumInstances(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference,
+ const char **properties)
+{
+ return alloc_cap_instances(_BROKER, reference, results, false, properties);
+}
+
DEFAULT_CI();
DEFAULT_MI();
DEFAULT_DI();
17 years, 1 month
[PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1195510519 18000
# Node ID 9e000f9f9096cad7a40b1221b467fe99efc4b93f
# Parent 79f43a4ffc38d7227e17432b971639ae20f6f6ed
Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work.
I don't have a ton of experience with instance providers, so this might require a little extra scrutiny as I'm sure there are several rookie mistakes.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 79f43a4ffc38 -r 9e000f9f9096 src/Makefile.am
--- a/src/Makefile.am Mon Nov 19 16:19:06 2007 -0500
+++ b/src/Makefile.am Mon Nov 19 17:15:19 2007 -0500
@@ -91,9 +91,9 @@ libVirt_ElementCapabilities_la_LIBADD =
-lVirt_ComputerSystem \
-lVirt_HostSystem
-libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la
+libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la
libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c
-libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD
+libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool
libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
diff -r 79f43a4ffc38 -r 9e000f9f9096 src/Virt_AllocationCapabilities.c
--- a/src/Virt_AllocationCapabilities.c Mon Nov 19 16:19:06 2007 -0500
+++ b/src/Virt_AllocationCapabilities.c Mon Nov 19 17:15:19 2007 -0500
@@ -32,6 +32,7 @@
#include "Virt_AllocationCapabilities.h"
#include "Virt_RASD.h"
+#include "Virt_DevicePool.h"
const static CMPIBroker *_BROKER;
@@ -83,6 +84,88 @@ static CMPIStatus return_alloc_cap(const
else
CMReturnInstance(results, inst);
out:
+ return s;
+}
+
+static CMPIStatus alloc_cap_instances(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ const CMPIResult *results,
+ bool names_only,
+ const char **properties)
+{
+ int i;
+ virConnectPtr conn;
+ CMPIInstance *inst;
+ struct inst_list alloc_cap_list;
+ struct inst_list device_pool_list;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ CU_DEBUG("In alloc_cap_instances()");
+
+ inst_list_init(&device_pool_list);
+ inst_list_init(&alloc_cap_list);
+
+ if (!provider_is_responsible(broker, ref, &s))
+ goto out;
+
+ conn = lv_connect(_BROKER, &s);
+ if (conn == NULL)
+ goto out;
+
+ for (i = 0; device_pool_names[i]; i++) {
+ s = get_pool_by_type(broker,
+ conn,
+ device_pool_names[i],
+ NAMESPACE(ref),
+ &device_pool_list);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Error fetching device pools");
+ goto out;
+ }
+ }
+
+ for (i = 0; i < device_pool_list.cur; i++) {
+ inst = get_typed_instance(broker,
+ "AllocationCapabilities",
+ NAMESPACE(ref));
+ if (inst == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get alloc_cap instance");
+ goto out;
+ }
+
+ s = cu_copy_prop(broker, device_pool_list.list[i], inst,
+ "InstanceID", NULL);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Error copying InstanceID");
+ goto out;
+ }
+
+ s = cu_copy_prop(broker, device_pool_list.list[i], inst,
+ "ResourceType", NULL);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Error copying InstanceID");
+ goto out;
+ }
+
+ inst_list_add(&alloc_cap_list, inst);
+ }
+
+ if (names_only)
+ cu_return_instance_names(results, &alloc_cap_list);
+ else
+ cu_return_instances(results, &alloc_cap_list);
+
+ out:
+ inst_list_free(&alloc_cap_list);
+ inst_list_free(&device_pool_list);
return s;
}
@@ -95,8 +178,23 @@ static CMPIStatus GetInstance(CMPIInstan
return return_alloc_cap(reference, results, 0);
}
-DEFAULT_EI();
-DEFAULT_EIN();
+static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference)
+{
+ return alloc_cap_instances(_BROKER, reference, results, true, NULL);
+}
+
+static CMPIStatus EnumInstances(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *reference,
+ const char **properties)
+{
+ return alloc_cap_instances(_BROKER, reference, results, false, properties);
+}
+
DEFAULT_CI();
DEFAULT_MI();
DEFAULT_DI();
17 years, 1 month
[PATCH] Fix cu_return_foo calls to match new signature
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1195507146 18000
# Node ID 79f43a4ffc38d7227e17432b971639ae20f6f6ed
# Parent e3b63f17f18169dbd41ef979a86e56b46d8a9ae9
Fix cu_return_foo calls to match new signature.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r e3b63f17f181 -r 79f43a4ffc38 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Mon Nov 19 11:15:49 2007 -0800
+++ b/src/Virt_ComputerSystem.c Mon Nov 19 16:19:06 2007 -0500
@@ -356,9 +356,9 @@ static CMPIStatus return_enum_domains(co
}
if (names_only)
- cu_return_instance_names(results, list.list);
+ cu_return_instance_names(results, &list);
else
- cu_return_instances(results, list.list);
+ cu_return_instances(results, &list);
CMSetStatus(&s, CMPI_RC_OK);
diff -r e3b63f17f181 -r 79f43a4ffc38 src/Virt_Device.c
--- a/src/Virt_Device.c Mon Nov 19 11:15:49 2007 -0800
+++ b/src/Virt_Device.c Mon Nov 19 16:19:06 2007 -0500
@@ -366,9 +366,9 @@ static CMPIStatus enum_devices(const CMP
goto out;
if (names_only)
- cu_return_instance_names(results, list.list);
+ cu_return_instance_names(results, &list);
else
- cu_return_instances(results, list.list);
+ cu_return_instances(results, &list);
inst_list_free(&list);
diff -r e3b63f17f181 -r 79f43a4ffc38 src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c Mon Nov 19 11:15:49 2007 -0800
+++ b/src/Virt_DevicePool.c Mon Nov 19 16:19:06 2007 -0500
@@ -602,9 +602,9 @@ static void __return_pool(const CMPIResu
bool name_only)
{
if (name_only)
- cu_return_instance_names(results, list->list);
+ cu_return_instance_names(results, list);
else
- cu_return_instances(results, list->list);
+ cu_return_instances(results, list);
}
static CMPIStatus return_pool(const CMPIObjectPath *ref,
17 years, 1 month