[PATCH] This patch adds back the fake_host() functions and groups providers into a single process when used with OpenPegasus
by Chip Vincent
# HG changeset patch
# User Chip Vincent <cvincent(a)us.ibm.com>
# Date 1288135043 14400
# Node ID 0a19c3e95fdf1fdf263d150470333ecfb566115b
# Parent 756b9699be781c251b45ba8e4d9163ef485719e0
This patch adds back the fake_host() functions and groups providers into
a single process when used with OpenPegasus.
fake_host() is needed to ensure keys are propagated properly, and moving
providers into a single process is needed to ensure indications work as
expected (there are dependencies between some providers that do not work
as expected when they are run in different processes).
Signed-off-by: Chip Vincent <cvincent(a)us.ibm.com>
diff -r 756b9699be78 -r 0a19c3e95fdf provider-register.sh
--- a/provider-register.sh Tue Oct 19 13:48:49 2010 -0400
+++ b/provider-register.sh Tue Oct 26 19:17:23 2010 -0400
@@ -61,6 +61,7 @@
Version = "2.0.0";
InterfaceType = "CMPI";
InterfaceVersion = "2.0.0";
+ ModuleGroupName = "libvirt-cim";
};
EOFPM
diff -r 756b9699be78 -r 0a19c3e95fdf src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c Tue Oct 19 13:48:49 2010 -0400
+++ b/src/Virt_HostSystem.c Tue Oct 26 19:17:23 2010 -0400
@@ -38,7 +38,6 @@
const static CMPIBroker *_BROKER;
-/*
static int resolve_host(char *host, char *buf, int size)
{
struct hostent *he;
@@ -76,9 +75,7 @@
return 0;
}
-*/
-/*
static int get_fqdn(char *buf, int size)
{
char host[256];
@@ -96,9 +93,7 @@
return ret;
}
-*/
-/*
static int set_host_system_properties(CMPIInstance *instance)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -119,9 +114,7 @@
return 1;
}
-*/
-/*
static CMPIStatus fake_host(const CMPIBroker *broker,
const CMPIObjectPath *reference,
CMPIInstance **_inst)
@@ -157,7 +150,6 @@
return s;
}
-*/
CMPIStatus get_host(const CMPIBroker *broker,
const CMPIContext *context,
@@ -167,6 +159,8 @@
{
CMPIStatus s = {CMPI_RC_OK, NULL};
+ s = fake_host(broker, reference, _inst);
+
if (!is_get_inst && (s.rc == CMPI_RC_ERR_NOT_FOUND)) {
/* This is not an error */
return (CMPIStatus){CMPI_RC_OK, NULL};
--
Chip Vincent
Open Virtualization, Linux Technology Center
IBM Systems & Technology Group
phone: 919-254-4482, T/L 444-4482
email: cvincent(a)us.ibm.com
13 years, 9 months
[PATCH] Return profiles according to role
by Chip Vincent
# HG changeset patch
# User Chip Vincent <cvincent(a)us.ibm.com>
# Date 1287510529 14400
# Node ID 756b9699be781c251b45ba8e4d9163ef485719e0
# Parent 13c765505895c9de34908d8f4d02c9a67fe4b907
Return profiles according to role
Signed-off-by: Chip Vincent <cvincent(a)us.ibm.com>
diff -r 13c765505895 -r 756b9699be78 src/Virt_ReferencedProfile.c
--- a/src/Virt_ReferencedProfile.c Thu Oct 14 11:51:44 2010 -0400
+++ b/src/Virt_ReferencedProfile.c Tue Oct 19 13:48:49 2010 -0400
@@ -126,7 +126,14 @@
if (conn == NULL)
goto out;
- s = get_scoping_prof_by_source(ref, info, conn, source, list);
+ // NOTE: Autonomous or scoping profiles are dependent profiles.
+ // Return them according to role
+ if ((!source->scoping_profile ||
+ STREQC(source->reg_name, "System Virtualization")) &&
+ info->role && !STREQC(info->role, "Dependent"))
+ goto out;
+
+ s = get_scoping_prof_by_source(ref, info, conn, source, list);
if (s.rc != CMPI_RC_OK)
goto out;
--
Chip Vincent
Open Virtualization, Linux Technology Center
IBM Systems & Technology Group
phone: 919-254-4482, T/L 444-4482
email: cvincent(a)us.ibm.com
13 years, 9 months
[PATCH] Missing namespace from migration indications
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1286382665 25200
# Node ID a97431f4b91e5d4009e9f2e70dea7d7bc85464f5
# Parent d4beac1f62c6ad131f584b04460eb807aa46f0d4
Missing namespace from migration indications
This patch passes ObjectPath inside the indication when calling CBDeliverIndication.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r d4beac1f62c6 -r a97431f4b91e std_indication.c
--- a/std_indication.c Tue Sep 14 21:19:05 2010 -0400
+++ b/std_indication.c Wed Oct 06 09:31:05 2010 -0700
@@ -98,13 +98,15 @@
static CMPIStatus default_raise(const CMPIBroker *broker,
const CMPIContext *context,
+ CMPIObjectPath *ref,
CMPIInstance *ind)
{
- CMPIObjectPath *ref;
CMPIStatus s = {CMPI_RC_OK, NULL};
- ref = CMGetObjectPath(ind, NULL);
-
+ s = CMSetObjectPath(ind, ref);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
CBDeliverIndication(broker,
context,
NAMESPACE(ref),
@@ -114,13 +116,15 @@
static CMPIStatus raise(struct std_indication_ctx *ctx,
const CMPIContext *context,
- const CMPIArgs *argsin)
+ const CMPIArgs *argsin,
+ CMPIObjectPath *ref)
{
bool enabled;
CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
const char *ind_name = NULL;
+ CU_DEBUG("In raise");
if (cu_get_inst_arg(argsin, "TheIndication", &inst) != CMPI_RC_OK) {
cu_statusf(ctx->brkr, &s,
CMPI_RC_ERR_FAILED,
@@ -136,6 +140,8 @@
goto out;
}
+ CU_DEBUG("Indication is %s", ind_name);
+
enabled = is_ind_enabled(ctx, ind_name, &s);
if (s.rc != CMPI_RC_OK) {
CU_DEBUG("Problem checking enabled: '%s'", CMGetCharPtr(s.msg));
@@ -146,13 +152,14 @@
goto out;
if (ctx->handler == NULL || ctx->handler->raise_fn == NULL)
- s = default_raise(ctx->brkr, context, inst);
+ s = default_raise(ctx->brkr, context, ref, inst);
else
- s = ctx->handler->raise_fn(ctx->brkr, context, inst);
+ s = ctx->handler->raise_fn(ctx->brkr, context, ref, inst);
out:
return s;
}
+
CMPIStatus stdi_deliver(const CMPIBroker *broker,
const CMPIContext *ctx,
struct ind_args *args,
@@ -294,7 +301,7 @@
CMPIStatus stdi_handler(CMPIMethodMI *self,
const CMPIContext *context,
const CMPIResult *results,
- const CMPIObjectPath *reference,
+ CMPIObjectPath *reference,
const char *methodname,
const CMPIArgs *argsin,
CMPIArgs *argsout)
@@ -305,13 +312,13 @@
if (STREQC(methodname, "TriggerIndications"))
s = trigger(ctx, context);
else if (STREQ(methodname, "RaiseIndication"))
- s = raise(ctx, context, argsin);
+ s = raise(ctx, context, argsin, reference);
else
cu_statusf(ctx->brkr, &s,
CMPI_RC_ERR_FAILED,
"Invalid method");
- CMReturnDone(results);
+ CMReturnDone(results);
return s;
}
@@ -370,8 +377,15 @@
CMPIArgs *argsout;
op = CMNewObjectPath(broker, ns, type, &s);
- if (s.rc != CMPI_RC_OK)
+ if ((op == NULL) || (s.rc != CMPI_RC_OK)) {
+ CU_DEBUG("Unable to create path for indication %s",
+ type);
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to create path for indication %s",
+ type);
return s;
+ }
argsin = CMNewArgs(broker, &s);
if (s.rc != CMPI_RC_OK)
@@ -386,7 +400,7 @@
return s;
CBInvokeMethod(broker, context, op, method, argsin, argsout, &s);
-
+
return s;
}
diff -r d4beac1f62c6 -r a97431f4b91e std_indication.h
--- a/std_indication.h Tue Sep 14 21:19:05 2010 -0400
+++ b/std_indication.h Wed Oct 06 09:31:05 2010 -0700
@@ -41,6 +41,7 @@
typedef CMPIStatus (*raise_indication_t)(const CMPIBroker *broker,
const CMPIContext *ctx,
+ CMPIObjectPath *ref,
const CMPIInstance *ind);
typedef CMPIStatus (*trigger_indication_t)(const CMPIContext *ctx);
@@ -134,7 +135,7 @@
CMPIStatus stdi_handler(CMPIMethodMI *self,
const CMPIContext *context,
const CMPIResult *results,
- const CMPIObjectPath *reference,
+ CMPIObjectPath *reference,
const char *methodname,
const CMPIArgs *argsin,
CMPIArgs *argsout);
13 years, 10 months
[PATCH] Removing check for sblim host
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1286428013 14400
# Node ID dac5cb514b9a7668b7717ac07bf02b9fcdf3a78d
# Parent 96d09403ca73d1416c08f631899a4a99fa680b4d
Removing check for sblim host.
We are not using the sblim host in libvirt-cim.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 96d09403ca73 -r dac5cb514b9a suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Aug 06 05:45:50 2010 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Oct 07 01:06:53 2010 -0400
@@ -153,9 +153,12 @@
def get_host_info(server, virt):
try:
- status, linux_cs = check_sblim(server)
- if status == PASS:
- return status, linux_cs
+ # Commenting out sblim check as libvirt-cim is not supporting it anymore.
+ # Leaving them commented, in case we add support for sblim at later time.
+
+ # status, linux_cs = check_sblim(server)
+ # if status == PASS:
+ # return status, linux_cs
hs_class = get_typed_class(virt, 'HostSystem')
host_info = enumclass.EnumInstances(server, hs_class)
13 years, 11 months
[PATCH] Removing the code to fetch sblim instance
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1285806092 25200
# Node ID 4d59bde40044795f53f0a1e53bbf500ceb2b56fa
# Parent 2b22040708e97d0634d64d2a7e24205e7d701de3
Removing the code to fetch sblim instance.
This instance creates problem while getting
that instance.
Just returning fake host.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 2b22040708e9 -r 4d59bde40044 src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c Wed Sep 29 15:34:12 2010 -0700
+++ b/src/Virt_HostSystem.c Wed Sep 29 17:21:32 2010 -0700
@@ -151,66 +151,6 @@
return s;
}
-static CMPIStatus sblim_host(const CMPIBroker *broker,
- const CMPIContext *context,
- const CMPIObjectPath *ref,
- CMPIInstance **inst)
-{
- CMPIObjectPath *path;
- CMPIEnumeration *en = NULL;
- CMPIData data;
- CMPIStatus s;
- const char *cn = "Linux_ComputerSystem";
-
- path = CMNewObjectPath(broker, "root/cimv2", cn, &s);
- if ((path == NULL) || (s.rc != CMPI_RC_OK)) {
- cu_statusf(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Unable to create HostSystem path");
- return s;
- }
-
- /* FIXME: This approach may return the wrong instance if more than
- one SBLIM Linux_ComputerSystem instance exists on the system.
- This isn't likely to happen in most cases, but a better approach
- should be used here.
- */
- en = CBEnumInstances(broker, context, path, NULL, &s);
- if (en == NULL) {
- cu_statusf(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Upcall EnumInstances of %s class failed",
- cn);
- goto out;
- }
-
- if (CMHasNext(en, &s)) {
- data = CMGetNext(en, &s);
- if (CMIsNullObject(data.value.inst)) {
- cu_statusf(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to retrieve enumeration entry");
- goto out;
- }
-
- *inst = data.value.inst;
- } else {
- cu_statusf(broker, &s,
- CMPI_RC_ERR_FAILED,
- "No entry found");
- goto out;
- }
-
- out:
- if (s.rc != CMPI_RC_OK) {
- CU_DEBUG("SBLIM: %i %s", s.rc, CMGetCharPtr(s.msg));
- } else {
- CU_DEBUG("SBLIM: Returned instance");
- }
-
- return s;
-}
-
CMPIStatus get_host(const CMPIBroker *broker,
const CMPIContext *context,
const CMPIObjectPath *reference,
@@ -219,10 +159,6 @@
{
CMPIStatus s;
- s = sblim_host(broker, context, reference, _inst);
- if (s.rc != CMPI_RC_OK)
- s = fake_host(broker, reference, _inst);
-
if (!is_get_inst && (s.rc == CMPI_RC_ERR_NOT_FOUND)) {
/* This is not an error */
return (CMPIStatus){CMPI_RC_OK, NULL};
13 years, 11 months