[Libvirt-cim] [PATCH V6 05/20] CSI, DevicePool, RASDIndication: fix debug print crash

Wenchao Xia xiawenc at linux.vnet.ibm.com
Mon Mar 25 09:52:45 UTC 2013


Signed-off-by: Wenchao Xia <xiawenc at linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan at redhat.com>
Reviewed-by: Sharad Mishra <snmishra at us.ibm.com>
---
 src/Virt_ComputerSystemIndication.c                |    2 +-
 src/Virt_DevicePool.c                              |    2 +-
 src/Virt_ResourceAllocationSettingDataIndication.c |    6 +++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Virt_ComputerSystemIndication.c b/src/Virt_ComputerSystemIndication.c
index 3096683..8250850 100644
--- a/src/Virt_ComputerSystemIndication.c
+++ b/src/Virt_ComputerSystemIndication.c
@@ -504,7 +504,7 @@ static void csi_domain_event_cb(virConnectPtr conn,
         CMPIStatus s = {CMPI_RC_OK, NULL};
 
         if (lifecycle_enabled == false || thread->active_filters <= 0) {
-                CU_DEBUG("%s indications deactivated, return");
+                CU_DEBUG("%s indications deactivated, return", prefix);
                 return;
         }
 
diff --git a/src/Virt_DevicePool.c b/src/Virt_DevicePool.c
index 56c9715..08677e2 100644
--- a/src/Virt_DevicePool.c
+++ b/src/Virt_DevicePool.c
@@ -710,7 +710,7 @@ static bool mempool_set_consumed(CMPIInstance *inst, virConnectPtr conn)
 
                 dom = virDomainLookupByID(conn, domain_ids[i]);
                 if (dom == NULL) {
-                        CU_DEBUG("Cannot connect to domain %n: excluding",
+                        CU_DEBUG("Cannot connect to domain %d: excluding",
                                 domain_ids[i]);
                         continue;
                 }
diff --git a/src/Virt_ResourceAllocationSettingDataIndication.c b/src/Virt_ResourceAllocationSettingDataIndication.c
index a386132..93fb563 100644
--- a/src/Virt_ResourceAllocationSettingDataIndication.c
+++ b/src/Virt_ResourceAllocationSettingDataIndication.c
@@ -122,7 +122,11 @@ static CMPIStatus raise_indication(const CMPIBroker *broker,
         if (s.rc == CMPI_RC_OK) {
                 CU_DEBUG("Indication delivered");
         } else {
-                CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg));
+                if (s.msg == NULL) {
+                        CU_DEBUG("Not delivered: msg is NULL.");
+                } else {
+                        CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg));
+                }
         }
 
  out:
-- 
1.7.1





More information about the Libvirt-cim mailing list