[PATCH]
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1197410852 28800
# Node ID 8761c7b39ea87feb54f89e41e1a7044104ec9399
# Parent 6c3ca59055416d7bb07716d3a750800e6087878e
#2 GetInstance() does not return an instance that matches the instanceID given.
Updates - removed boolean and now use a string, get instanceID in GetInstance() call instead.
Add a argument to return_ele_cap() that handles the GetInstance(). If this argument is set, get the InstanceID from the ref. In the loop that walks through the domains on the system, check to see if this id matches one of the names returned. If there is a match, create the instance and then exit from the loop.
If no match is found, an error is returned.
Failing query:
wbemcli gi http://localhost:5988/root/virt:Xen_EnabledLogicalElementCapabilities.Ins..."kaitlin_test"
localhost:5988/root/virt:Xen_EnabledLogicalElementCapabilities.InstanceID="kaitlin_test" Caption,Description,InstanceID="hd_domain",ElementName,ElementNameEditSupported=FALSE,MaxElementNameLen,RequestedStatesSupported=2,3,9,10,11,ElementNameMask,StateAwareness,CreationClassName="Xen_EnabledLogicalElementCapabilities"
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 6c3ca5905541 -r 8761c7b39ea8 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Tue Dec 11 09:42:24 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Tue Dec 11 14:07:32 2007 -0800
@@ -21,6 +21,7 @@
*/
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include <cmpidt.h>
#include <cmpift.h>
@@ -135,7 +136,8 @@ CMPIStatus get_ele_cap(const CMPIBroker
static CMPIStatus return_ele_cap(const CMPIObjectPath *ref,
const CMPIResult *results,
- int names_only)
+ int names_only,
+ const char *id)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
@@ -162,6 +164,9 @@ static CMPIStatus return_ele_cap(const C
goto end;
}
+ if (id && (!STREQ(name, id)))
+ goto end;
+
s = get_ele_cap(_BROKER, ref, name, &inst);
if (s.rc != CMPI_RC_OK)
goto end;
@@ -174,7 +179,7 @@ static CMPIStatus return_ele_cap(const C
end:
virDomainFree(list[i]);
- if (s.rc != CMPI_RC_OK)
+ if ((s.rc != CMPI_RC_OK) || (id && (STREQ(name, id))))
goto out;
}
@@ -191,7 +196,7 @@ static CMPIStatus EnumInstanceNames(CMPI
const CMPIResult *results,
const CMPIObjectPath *reference)
{
- return return_ele_cap(reference, results, 1);
+ return return_ele_cap(reference, results, 1, NULL);
}
static CMPIStatus EnumInstances(CMPIInstanceMI *self,
@@ -201,7 +206,7 @@ static CMPIStatus EnumInstances(CMPIInst
const char **properties)
{
- return return_ele_cap(reference, results, 0);
+ return return_ele_cap(reference, results, 0, NULL);
}
static CMPIStatus GetInstance(CMPIInstanceMI *self,
@@ -210,7 +215,17 @@ static CMPIStatus GetInstance(CMPIInstan
const CMPIObjectPath *reference,
const char **properties)
{
- return return_ele_cap(reference, results, 0);
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ const char* id;
+
+ if (cu_get_str_path(reference, "InstanceID", &id) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No InstanceID specified");
+ return s;
+ }
+
+ return return_ele_cap(reference, results, 0, id);
}
DEFAULT_CI();
17 years
[PATCH 0 of 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
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 1197367712 -3600
# Node ID 8ef14daa017090e8473e1f958bc5e5e584032398
# 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 8ef14daa0170 std_association.c
--- a/std_association.c Fri Dec 07 17:15:07 2007 -0500
+++ b/std_association.c Tue Dec 11 11:08:32 2007 +0100
@@ -226,21 +226,23 @@ static CMPIStatus do_assoc(struct std_as
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);
+ int i;
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.");
+
+ inst_list_init(&list);
CU_DEBUG("Calling handler->handler...");
s = handler->handler(ref, info, &list);
@@ -257,73 +259,48 @@ static CMPIStatus do_assoc(struct std_as
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);
- }
-
- 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;
-
+ /* Associators and AssociatorNames */
+ if (!ref_rslt) {
+ 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);
+ }
+ }
+
+ /* References and ReferenceNames */
+ if (ref_rslt) {
+ 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);
+ }
+ }
+ /* Associators and AssociatorNames */
+ else {
if (names_only)
- cu_return_instance_name(results, refinst);
+ cu_return_instance_names(results, &list);
else
- CMReturnInstance(results, refinst);
- }
-
- CMSetStatus(&s, CMPI_RC_OK);
+ cu_return_instances(results, &list);
+ }
+
out:
inst_list_free(&list);
@@ -359,6 +336,7 @@ CMPIStatus stda_AssociatorNames(CMPIAsso
&info,
results,
reference,
+ false,
true);
}
@@ -386,6 +364,7 @@ CMPIStatus stda_Associators(CMPIAssociat
&info,
results,
reference,
+ false,
false);
}
@@ -406,7 +385,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 +411,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
[PATCH] Fix VSMS.RemoveResources() to take references instead of EOs
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1197487329 28800
# Node ID 59eb8770d96a71707804f26aec48ae76531b005e
# Parent b6c16e5a2a347b1e6a6fe314864865a9c6152532
Fix VSMS.RemoveResources() to take references instead of EOs
This just adds a filter function that converts the references into
instances. It could be more efficient, but I think that allowing all
of the resource operations to remain largely identical (as they did before)
is worth the small amount of overhead here.
Also added REF2STR() macro to misc_util.h. I do this a lot, mostly
while testing, but it seems valid to have such a macro so we can start
printing out more useful error messages with ease.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r b6c16e5a2a34 -r 59eb8770d96a libxkutil/misc_util.h
--- a/libxkutil/misc_util.h Wed Dec 12 09:42:09 2007 -0800
+++ b/libxkutil/misc_util.h Wed Dec 12 11:22:09 2007 -0800
@@ -129,6 +129,8 @@ CMPIInstance *make_reference(const CMPIB
assoc); \
}
+#define REF2STR(r) CMGetCharPtr(CMObjectPathToString(r, NULL))
+
/*
* Local Variables:
* mode: C
diff -r b6c16e5a2a34 -r 59eb8770d96a src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Dec 12 09:42:09 2007 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 12 11:22:09 2007 -0800
@@ -947,6 +947,59 @@ static CMPIStatus update_resource_settin
return s;
}
+static CMPIStatus rasd_refs_to_insts(const CMPIContext *ctx,
+ const CMPIObjectPath *reference,
+ CMPIArray *arr,
+ struct inst_list *list)
+{
+ CMPIStatus s;
+ int i;
+ int c;
+
+ c = CMGetArrayCount(arr, &s);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
+ for (i = 0; i < c; i++) {
+ CMPIData d;
+ CMPIObjectPath *ref;
+ CMPIInstance *inst;
+ const char *id;
+ uint16_t type;
+
+ d = CMGetArrayElementAt(arr, i, &s);
+ ref = d.value.ref;
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Unable to get ResourceSettings[%i]", i);
+ continue;
+ }
+
+ if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
+ CU_DEBUG("Unable to get InstanceID of `%s'",
+ REF2STR(ref));
+ continue;
+ }
+
+ if (rasd_type_from_classname(CLASSNAME(ref), &type) !=
+ CMPI_RC_OK) {
+ CU_DEBUG("Unable to get type of `%s'",
+ REF2STR(ref));
+ continue;
+ }
+
+ inst = get_rasd_instance(ctx, reference, _BROKER, id, type);
+ if (inst != NULL)
+ inst_list_add(list, inst);
+ else
+ CU_DEBUG("Failed to get instance for `%s'",
+ REF2STR(ref));
+ }
+
+ CMSetStatus(&s, CMPI_RC_OK);
+
+ return s;
+}
+
static CMPIStatus add_resource_settings(CMPIMethodMI *self,
const CMPIContext *context,
const CMPIResult *results,
@@ -974,7 +1027,32 @@ static CMPIStatus rm_resource_settings(C
const CMPIArgs *argsin,
CMPIArgs *argsout)
{
- return update_resource_settings(reference, argsin, resource_del);
+ /* The RemoveResources case is different from either Add or
+ * Modify, because it takes references instead of instances
+ */
+
+ CMPIArray *arr;
+ CMPIStatus s;
+ struct inst_list list;
+
+ inst_list_init(&list);
+
+ if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing ResourceSettings");
+ goto out;
+ }
+
+ s = rasd_refs_to_insts(context, reference, arr, &list);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = _update_resource_settings(reference, &list, resource_del);
+ out:
+ inst_list_free(&list);
+
+ return s;
}
static struct method_handler DefineSystem = {
@@ -1023,7 +1101,7 @@ static struct method_handler RemoveResou
static struct method_handler RemoveResourceSettings = {
.name = "RemoveResourceSettings",
.handler = rm_resource_settings,
- .args = {{"ResourceSettings", CMPI_stringA},
+ .args = {{"ResourceSettings", CMPI_refA},
ARG_END
}
};
17 years
[PATCH] RPM spec updates
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1197481264 28800
# Node ID c37e79945f4f7272be9f4ffa2d464aed09e3b445
# Parent 85e3ec9836b74c4d3424fc4e67d7c6a22c00863d
RPM spec updates
- Restart the CIMOM after base schema installation
- Installed file cleanups
- Permissions cleanups
- Require correct version of libvirt
- Require unzip, since we need it for base schema unpacking
- Require explicit verison of libxml2 (for rpmlint). I have no idea what
version is actually required, so I took the F8 version. If someone has
an opinion or complaint about this, I'm happy to change it.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 85e3ec9836b7 -r c37e79945f4f libvirt-cim.spec.in
--- a/libvirt-cim.spec.in Wed Dec 12 08:40:39 2007 -0800
+++ b/libvirt-cim.spec.in Wed Dec 12 09:41:04 2007 -0800
@@ -9,10 +9,11 @@ Source: libvirt-cim-%{version}.tar.gz
Source: libvirt-cim-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/CIM/
-Requires: libxml2
-Requires: libvirt >= 0.2.3
+Requires: libxml2 >= 2.6.0
+Requires: libvirt >= 0.3.2
+Requires: unzip
BuildRequires: tog-pegasus-devel
-BuildRequires: libvirt-devel >= 0.2.3
+BuildRequires: libvirt-devel >= 0.3.2
BuildRequires: e2fsprogs-devel
BuildRequires: libxml2-devel
BuildRequires: libcmpiutil-devel
@@ -26,7 +27,8 @@ platforms with a single provider.
%prep
%setup -q
-chmod -x src/* libxkutil/* schema/*
+chmod -x src/* libxkutil/* schema/* README doc/* base_schema/README*
+chmod +X src/* libxkutil/* schema/*
%build
%configure --disable-werror
@@ -40,6 +42,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a
+rm -f $RPM_BUILD_ROOT%{_libdir}/libxkutil.so
%clean
rm -fr $RPM_BUILD_ROOT
@@ -57,22 +60,24 @@ rm -fr $RPM_BUILD_ROOT
%{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name}
+/etc/init.d/tog-pegasus restart
+
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n /@CIM_VIRT_NS@ \
- -r %{REGISTRATION} -m %{SCHEMA} || true
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%preun
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n /@CIM_VIRT_NS@ \
- -r %{REGISTRATION} -m %{SCHEMA} || true
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
-%doc README doc/CodingStyle doc/SubmittingPatches
-%doc provider-register.sh
+%doc README COPYING doc/CodingStyle doc/SubmittingPatches
+%doc base_schema/README.DMTF
%doc doc/*.html
%{_libdir}/lib*.so*
%{_libdir}/cmpi/lib*.so*
17 years
[PATCH] Make 'clean' remove temporary files and patch rejects
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1197477639 28800
# Node ID 85e3ec9836b74c4d3424fc4e67d7c6a22c00863d
# Parent 2854fb11364df047bb6d275e72034145b2260c71
Make 'clean' remove temporary files and patch rejects
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 2854fb11364d -r 85e3ec9836b7 Makefile.am
--- a/Makefile.am Tue Dec 11 14:51:07 2007 -0800
+++ b/Makefile.am Wed Dec 12 08:40:39 2007 -0800
@@ -104,3 +104,8 @@ preuninstall:
rpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
+
+clean-local:
+ rm -f $(find . -name "*.orig")
+ rm -f $(find . -name "*.rej")
+ rm -f $(find . -name "*~")
\ No newline at end of file
17 years
[PATCH] RPM spec updates
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1197478221 28800
# Node ID de0e1bd9377b3e3325eec951ed0b0bf5100f565c
# Parent c9edd5bc7202c0ee76bfba68aac98fd97ca87b34
RPM spec updates
- Restart the CIMOM after base schema installation
- Installed file cleanups
- Permissions cleanups
- Require correct version of libvirt
- Require unzip, since we need it for base schema unpacking
- Require explicit verison of libxml2 (for rpmlint). I have no idea what
version is actually required, so I took the F8 version. If someone has
an opinion or complaint about this, I'm happy to change it.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c9edd5bc7202 -r de0e1bd9377b libvirt-cim.spec.in
--- a/libvirt-cim.spec.in Wed Dec 12 08:42:39 2007 -0800
+++ b/libvirt-cim.spec.in Wed Dec 12 08:50:21 2007 -0800
@@ -9,10 +9,11 @@ Source: libvirt-cim-%{version}.tar.gz
Source: libvirt-cim-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/CIM/
-Requires: libxml2
-Requires: libvirt >= 0.2.3
+Requires: libxml2 >= 2.6.30
+Requires: libvirt >= 0.3.2
+Requires: unzip
BuildRequires: tog-pegasus-devel
-BuildRequires: libvirt-devel >= 0.2.3
+BuildRequires: libvirt-devel >= 0.3.2
BuildRequires: e2fsprogs-devel
BuildRequires: libxml2-devel
BuildRequires: libcmpiutil-devel
@@ -26,7 +27,8 @@ platforms with a single provider.
%prep
%setup -q
-chmod -x src/* libxkutil/* schema/*
+chmod -x src/* libxkutil/* schema/* README doc/* base_schema/README*
+chmod +X src/* libxkutil/* schema/*
%build
%configure --disable-werror
@@ -40,6 +42,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a
+rm -f $RPM_BUILD_ROOT%{_libdir}/libxkutil.so
%clean
rm -fr $RPM_BUILD_ROOT
@@ -57,22 +60,24 @@ rm -fr $RPM_BUILD_ROOT
%{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name}
+/etc/init.d/tog-pegasus restart
+
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n /@CIM_VIRT_NS@ \
- -r %{REGISTRATION} -m %{SCHEMA} || true
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%preun
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n /@CIM_VIRT_NS@ \
- -r %{REGISTRATION} -m %{SCHEMA} || true
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
-%doc README doc/CodingStyle doc/SubmittingPatches
-%doc provider-register.sh
+%doc README COPYING doc/CodingStyle doc/SubmittingPatches
+%doc base_schema/README.DMTF
%doc doc/*.html
%{_libdir}/lib*.so*
%{_libdir}/cmpi/lib*.so*
17 years
[PATCH] Make schema zip download during 'build', not 'dist'
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1197477759 28800
# Node ID c9edd5bc7202c0ee76bfba68aac98fd97ca87b34
# Parent 85e3ec9836b74c4d3424fc4e67d7c6a22c00863d
Make schema zip download during 'build', not 'dist'
This makes the tarball not include the zip, which is close to 2MB in size.
I think it's safe to assume that users of the tarball can allow the wget
of the zip file during build. For the RPM, I will make it download the
zip during 'dist' so that the SRPM already contains it.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 85e3ec9836b7 -r c9edd5bc7202 base_schema/Makefile.am
--- a/base_schema/Makefile.am Wed Dec 12 08:40:39 2007 -0800
+++ b/base_schema/Makefile.am Wed Dec 12 08:42:39 2007 -0800
@@ -2,8 +2,9 @@ CIM_SCHEMA_REL = $(CIM_SCHEMA_VER)Experi
CIM_SCHEMA_REL = $(CIM_SCHEMA_VER)Experimental
CIM_SCHEMA_ZIP = cimv$(CIM_SCHEMA_REL)-MOFs.zip
-dist_pkgdata_DATA = $(CIM_SCHEMA_ZIP) fix_schema.patch cimv216-interop_mof
+pkgdata_DATA = $(CIM_SCHEMA_ZIP)
+dist_pkgdata_DATA = fix_schema.patch cimv216-interop_mof
dist_pkgdata_SCRIPTS = install_base_schema.sh
$(CIM_SCHEMA_ZIP):
- wget http://www.dmtf.org/standards/cim/cim_schema_v$(CIM_SCHEMA_VER)/$(CIM_SCH...
\ No newline at end of file
+ wget http://www.dmtf.org/standards/cim/cim_schema_v$(CIM_SCHEMA_VER)/$(CIM_SCH...
17 years
[PATCH] GetInstance() does not return an instance that matches the instanceID given
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1197405880 28800
# Node ID daf4ce2d8c17b0c5bbe410a5a0d67bf5544f52ce
# Parent 6c3ca59055416d7bb07716d3a750800e6087878e
GetInstance() does not return an instance that matches the instanceID given.
Add a argument to return_ele_cap() that handles the GetInstance(). If this argument is set, get the InstanceID from the ref. In the loop that walks through the domains on the system, check to see if this id matches one of the names returned. If there is a match, create the instance and then exit from the loop.
If no match is found, an error is returned.
Failing query:
wbemcli gi http://localhost:5988/root/virt:Xen_EnabledLogicalElementCapabilities.Ins..."kaitlin_test"
localhost:5988/root/virt:Xen_EnabledLogicalElementCapabilities.InstanceID="kaitlin_test" Caption,Description,InstanceID="hd_domain",ElementName,ElementNameEditSupported=FALSE,MaxElementNameLen,RequestedStatesSupported=2,3,9,10,11,ElementNameMask,StateAwareness,CreationClassName="Xen_EnabledLogicalElementCapabilities"
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 6c3ca5905541 -r daf4ce2d8c17 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Tue Dec 11 09:42:24 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Tue Dec 11 12:44:40 2007 -0800
@@ -21,6 +21,7 @@
*/
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include <cmpidt.h>
#include <cmpift.h>
@@ -135,7 +136,8 @@ CMPIStatus get_ele_cap(const CMPIBroker
static CMPIStatus return_ele_cap(const CMPIObjectPath *ref,
const CMPIResult *results,
- int names_only)
+ int names_only,
+ int get_instance)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
@@ -144,10 +146,20 @@ static CMPIStatus return_ele_cap(const C
int count;
int i;
const char *name;
+ const char* id;
conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
if (conn == NULL)
goto out;
+
+ if (get_instance) {
+ if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No InstanceID specified");
+ goto out;
+ }
+ }
count = get_domain_list(conn, &list);
if (count <= 0)
@@ -162,6 +174,11 @@ static CMPIStatus return_ele_cap(const C
goto end;
}
+ if (get_instance) {
+ if (!STREQ(name, id))
+ goto end;
+ }
+
s = get_ele_cap(_BROKER, ref, name, &inst);
if (s.rc != CMPI_RC_OK)
goto end;
@@ -174,7 +191,7 @@ static CMPIStatus return_ele_cap(const C
end:
virDomainFree(list[i]);
- if (s.rc != CMPI_RC_OK)
+ if ((s.rc != CMPI_RC_OK) || (STREQ(name, id)))
goto out;
}
@@ -191,7 +208,7 @@ static CMPIStatus EnumInstanceNames(CMPI
const CMPIResult *results,
const CMPIObjectPath *reference)
{
- return return_ele_cap(reference, results, 1);
+ return return_ele_cap(reference, results, 1, 0);
}
static CMPIStatus EnumInstances(CMPIInstanceMI *self,
@@ -201,7 +218,7 @@ static CMPIStatus EnumInstances(CMPIInst
const char **properties)
{
- return return_ele_cap(reference, results, 0);
+ return return_ele_cap(reference, results, 0, 0);
}
static CMPIStatus GetInstance(CMPIInstanceMI *self,
@@ -210,7 +227,7 @@ static CMPIStatus GetInstance(CMPIInstan
const CMPIObjectPath *reference,
const char **properties)
{
- return return_ele_cap(reference, results, 0);
+ return return_ele_cap(reference, results, 0, 1);
}
DEFAULT_CI();
17 years
[PATCH 0 of 2] #2 Fix SDC - AllocationCapabilities to RASD error.
by Kaitlin Rupert
This patch set includes a function that uses a resource pool InstanceID to determine the resource type. SDC has been updated to use this function instead of using the ref's ResourceType attribute (which might not be available).
Updates from original patchset:
Was using device_type_from_classname(), which is intended to get the resource type from Device instance classnames. It doesn't properly support resource pool InstanceIDs.
17 years