+1

Sharad Mishra
Open Virtualization
Linux Technology Center
IBM

Inactive hide details for Chip Vincent ---12/29/2010 02:55:57 PM---# HG changeset patchChip Vincent ---12/29/2010 02:55:57 PM---# HG changeset patch

          Chip Vincent <cvincent@linux.vnet.ibm.com>
          Sent by: libvirt-cim-bounces@redhat.com

          12/29/2010 02:54 PM
          Please respond to
          List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>


To

List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>

cc


Subject

[Libvirt-cim] [PATCH] (#2) Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31

# HG changeset patch
# User Chip Vincent <cvincent@us.ibm.com>
# Date 1293663180 18000
# Node ID 7b2e9efc2778533b14fd7a4ac82b840a3baec275
# Parent  35396e5b805193c024b6d4f065136d7b57a0b03d
Update indication providers to the std_indication interface change
introduced in libcmpiutil f967d9432f31.

This fix is needed to build libvirt-cim with the latest
libcmpiutil-devel headers. There will be a small patch
coming for std_indication.h shortly to ensure 0 warnings.

Signed-off-by: Chip Vincent <cvincent@us.ibm.com>

diff -r 35396e5b8051 -r 7b2e9efc2778 libvirt-cim.spec.in
--- a/libvirt-cim.spec.in       Tue Dec 14 13:59:51 2010 -0800
+++ b/libvirt-cim.spec.in       Wed Dec 29 17:53:00 2010 -0500
@@ -10,10 +10,10 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL:
http://libvirt.org/CIM/
Requires: libxml2 >= 2.6.0
-Requires: libvirt >= 0.3.2
+Requires: libvirt >= 0.6.3
Requires: unzip
BuildRequires: tog-pegasus-devel
-BuildRequires: libvirt-devel >= 0.3.2
+BuildRequires: libvirt-devel >= 0.5.3
BuildRequires: e2fsprogs-devel
BuildRequires: libxml2-devel
BuildRequires: libcmpiutil-devel
diff -r 35396e5b8051 -r 7b2e9efc2778 src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c       Tue Dec 14 13:59:51 2010
-0800
+++ b/src/Virt_ComputerSystemIndication.c       Wed Dec 29 17:53:00 2010
-0500
@@ -787,12 +787,13 @@

static CMPIStatus raise_indication(const CMPIBroker *broker,
                                   const CMPIContext *ctx,
+                                   const CMPIObjectPath *ref,
                                   const CMPIInstance *ind)
{
        CMPIStatus s = {CMPI_RC_OK, NULL};
        CMPIInstance *prev_inst;
        CMPIInstance *src_inst;
-        CMPIObjectPath *ref = NULL;
+        CMPIObjectPath *_ref = NULL;
        struct std_indication_ctx *_ctx = NULL;
        struct ind_args *args = NULL;
        char *prefix = NULL;
@@ -809,7 +810,7 @@
        if (s.rc != CMPI_RC_OK || CMIsNullObject(prev_inst))
                goto out;

-        ref = CMGetObjectPath(prev_inst, &s);
+        _ref = CMGetObjectPath(prev_inst, &s);
        if (s.rc != CMPI_RC_OK) {
                cu_statusf(broker, &s,
                           CMPI_RC_ERR_FAILED,
@@ -819,10 +820,10 @@

        /* FIXME:  This is a Pegasus work around. Pegsus loses the
namespace
                   when an ObjectPath is pulled from an instance */
-        if (STREQ(NAMESPACE(ref), ""))
-                CMSetNameSpace(ref, "root/virt");
+        if (STREQ(NAMESPACE(_ref), ""))
+                CMSetNameSpace(_ref, "root/virt");

-        s = get_domain_by_ref(broker, ref, &src_inst);
+        s = get_domain_by_ref(broker, _ref, &src_inst);
        if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst))
                goto out;

@@ -847,8 +848,8 @@
                goto out;
        }

-        args->ns = strdup(NAMESPACE(ref));
-        args->classname = strdup(CLASSNAME(ref));
+        args->ns = strdup(NAMESPACE(_ref));
+        args->classname = strdup(CLASSNAME(_ref));
        args->_ctx = _ctx;

        prefix = class_prefix_name(args->classname);
diff -r 35396e5b8051 -r 7b2e9efc2778
src/Virt_ResourceAllocationSettingDataIndication.c
--- a/src/Virt_ResourceAllocationSettingDataIndication.c        Tue Dec
14 13:59:51 2010 -0800
+++ b/src/Virt_ResourceAllocationSettingDataIndication.c        Wed Dec
29 17:53:00 2010 -0500
@@ -68,12 +68,13 @@

static CMPIStatus raise_indication(const CMPIBroker *broker,
                                   const CMPIContext *ctx,
+                                   const CMPIObjectPath *ref,
                                   const CMPIInstance *ind)
{
        struct std_indication_ctx *_ctx = NULL;
        CMPIStatus s = {CMPI_RC_OK, NULL};
        struct ind_args *args = NULL;
-        CMPIObjectPath *ref = NULL;
+        CMPIObjectPath *_ref = NULL;

        _ctx = malloc(sizeof(struct std_indication_ctx));
        if (_ctx == NULL) {
@@ -96,8 +97,8 @@
                goto out;
        }

-        ref = CMGetObjectPath(ind, &s);
-        if (ref == NULL) {
+        _ref = CMGetObjectPath(ind, &s);
+        if (_ref == NULL) {
                cu_statusf(broker, &s,
                           CMPI_RC_ERR_FAILED,
                           "Got a null object path");
@@ -108,14 +109,14 @@
                   when an ObjectPath is pulled from an instance */


-        CMSetNameSpace(ref, "root/virt");
-        args->ns = strdup(NAMESPACE(ref));
-        args->classname = strdup(CLASSNAME(ref));
+        CMSetNameSpace(_ref, "root/virt");
+        args->ns = strdup(NAMESPACE(_ref));
+        args->classname = strdup(CLASSNAME(_ref));
        args->_ctx = _ctx;

        /* This is a workaround for Pegasus, it loses its objectpath by
           CMGetObjectPath. So set it back. */
-        ind->ft->setObjectPath((CMPIInstance *)ind, ref);
+        ind->ft->setObjectPath((CMPIInstance *)ind, _ref);

        s = stdi_deliver(broker, ctx, args, (CMPIInstance *)ind);
        if (s.rc == CMPI_RC_OK) {

--
Chip Vincent
Open Virtualization, Linux Technology Center
IBM Systems & Technology Group
phone: 919-254-4482, T/L 444-4482
email: cvincent@us.ibm.com

_______________________________________________
Libvirt-cim mailing list
Libvirt-cim@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim