
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1225739070 28800 # Node ID 7e9da8337ee60e6c73f020e37d22d692c0c7d494 # Parent 0d457a0fb221a91662cdbd90ccd803941a07db48 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 0d457a0fb221 -r 7e9da8337ee6 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Oct 29 15:17:11 2008 -0700 +++ b/libxkutil/misc_util.c Mon Nov 03 11:04:30 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 0d457a0fb221 -r 7e9da8337ee6 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Oct 29 15:17:11 2008 -0700 +++ b/libxkutil/misc_util.h Mon Nov 03 11:04:30 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, \