
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1225811646 28800 # Node ID e6f0f20c357e04f9285ef99ab642ec398e7f51b2 # Parent 1e1954312a8adb776cc62703d3363fe7f82c0069 Add a function that converts a SBLIM host system instance to something with a platform prefix. This is just used to satisfy lower layers that key off the platform prefix (i.e. KVM_) of a class name to determine how to connect to libvirt. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r 1e1954312a8a -r e6f0f20c357e libxkutil/misc_util.c --- a/libxkutil/misc_util.c Fri Oct 31 13:06:10 2008 -0700 +++ b/libxkutil/misc_util.c Tue Nov 04 07:14:06 2008 -0800 @@ -37,6 +37,8 @@ #include "misc_util.h" #include "cs_util.h" + +#include <config.h> #define URI_ENV "HYPURI" @@ -580,6 +582,31 @@ return actual; } +CMPIObjectPath *convert_sblim_hostsystem(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc_info *info) +{ + CMPIObjectPath *vref = NULL; + CMPIStatus s; + char *base = NULL; + char *cn = NULL; + + base = class_base_name(CLASSNAME(ref)); + if (base == NULL) + goto out; + + cn = get_typed_class(info->assoc_class, base); + if (cn == NULL) + goto out; + + vref = CMNewObjectPath(broker, CIM_VIRT_NS, cn, &s); + out: + free(base); + free(cn); + + return vref; +} + /* * Local Variables: * mode: C diff -r 1e1954312a8a -r e6f0f20c357e libxkutil/misc_util.h --- a/libxkutil/misc_util.h Fri Oct 31 13:06:10 2008 -0700 +++ b/libxkutil/misc_util.h Tue Nov 04 07:14:06 2008 -0800 @@ -126,6 +126,10 @@ int domain_vcpu_count(virDomainPtr dom); +CMPIObjectPath *convert_sblim_hostsystem(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc_info *info); + #define LIBVIRT_CIM_DEFAULT_MAKEREF() \ static CMPIInstance* make_ref(const CMPIObjectPath *source_ref, \ const CMPIInstance *target_inst, \