From snmishra at us.ibm.com Wed Oct 6 16:33:01 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 06 Oct 2010 16:33:01 -0000 Subject: [Libvirt-cim] [PATCH] Missing namespace from migration indications Message-ID: # HG changeset patch # User Sharad Mishra # 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 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); From snmishra at us.ibm.com Thu Oct 7 05:08:17 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 07 Oct 2010 05:08:17 -0000 Subject: [Libvirt-cim] [PATCH] Removing check for sblim host Message-ID: # HG changeset patch # User Sharad Mishra # 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 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) From cvincent at linux.vnet.ibm.com Wed Oct 13 19:02:47 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Wed, 13 Oct 2010 15:02:47 -0400 Subject: [Libvirt-cim] [PATCH] Removing the code to fetch sblim instance In-Reply-To: <4d59bde40044795f53f0.1285806103@elm3b217.beaverton.ibm.com> References: <4d59bde40044795f53f0.1285806103@elm3b217.beaverton.ibm.com> Message-ID: <4CB60257.8080802@linux.vnet.ibm.com> +1. NOTE: Since the fake_host function (and underlying functions) are not currently used, they are generating warnings (which are treated as errors with current compiler settings). As such, I'm going to comment out those functions along with this patch. Sharad Mishra wrote: > # HG changeset patch > # User Sharad Mishra > # 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 > > 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}; > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From tyreld at us.ibm.com Wed Oct 13 22:03:56 2010 From: tyreld at us.ibm.com (Tyrel Datwyler) Date: Wed, 13 Oct 2010 16:03:56 -0600 Subject: [Libvirt-cim] Tyrel Datwyler is out of the office. Message-ID: I will be out of the office starting 10/13/2010 and will not return until 10/18/2010. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvincent at linux.vnet.ibm.com Thu Oct 14 15:55:44 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Thu, 14 Oct 2010 11:55:44 -0400 Subject: [Libvirt-cim] [PATCH] Removing check for sblim host In-Reply-To: References: Message-ID: <4CB72800.6070605@linux.vnet.ibm.com> + 1 Sharad Mishra wrote: > # HG changeset patch > # User Sharad Mishra > # 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 > > 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) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From cvincent at linux.vnet.ibm.com Tue Oct 19 18:06:31 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 19 Oct 2010 14:06:31 -0400 Subject: [Libvirt-cim] [PATCH] Return profiles according to role Message-ID: <4CBDDE27.7030509@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # Date 1287510529 14400 # Node ID 756b9699be781c251b45ba8e4d9163ef485719e0 # Parent 13c765505895c9de34908d8f4d02c9a67fe4b907 Return profiles according to role Signed-off-by: Chip Vincent 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 at us.ibm.com From cvincent at linux.vnet.ibm.com Tue Oct 26 23:22:17 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 26 Oct 2010 19:22:17 -0400 Subject: [Libvirt-cim] [PATCH] This patch adds back the fake_host() functions and groups providers into a single process when used with OpenPegasus Message-ID: <4CC762A9.4030302@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # 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 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 at us.ibm.com