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

Sharad Mishra snmishra at us.ibm.com
Thu Dec 30 18:05:37 UTC 2010



+1

Sharad Mishra
Open Virtualization
Linux Technology Center
IBM


                                                                           
             Chip Vincent                                                  
             <cvincent at linux.v                                             
             net.ibm.com>                                               To 
             Sent by:                  List for discussion and development 
             libvirt-cim-bounc         of libvirt CIM                      
             es at redhat.com             <libvirt-cim at redhat.com>            
                                                                        cc 
                                                                           
             12/29/2010 02:54                                      Subject 
             PM                        [Libvirt-cim] [PATCH] (#2) Update   
                                       indication providers to the         
                                       std_indication interface change     
             Please respond to         introduced in libcmpiutil           
                 List for              f967d9432f31                        
              discussion and                                               
              development of                                               
              libvirt CIM                                               
             <libvirt-cim at redh                                             
                  at.com>                                                  
                                                                           
                                                                           




# HG changeset patch
# User Chip Vincent <cvincent at 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 at 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 at us.ibm.com

_______________________________________________
Libvirt-cim mailing list
Libvirt-cim at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20101230/c2b595e0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20101230/c2b595e0/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic02898.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20101230/c2b595e0/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20101230/c2b595e0/attachment-0002.gif>


More information about the Libvirt-cim mailing list