
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1226593541 28800 # Node ID be6fcb7b57d4cc727c5ee904e0c2e55444eafe81 # Parent 75896120cb575bd760de39f316a640582c09dd55 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 75896120cb57 -r be6fcb7b57d4 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Nov 05 15:09:49 2008 -0800 +++ b/libxkutil/misc_util.c Thu Nov 13 08:25:41 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 75896120cb57 -r be6fcb7b57d4 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Nov 05 15:09:49 2008 -0800 +++ b/libxkutil/misc_util.h Thu Nov 13 08:25:41 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, \