os-cmpi-xen

changeset 107:69ad830f2a6e

Changed Xen_DiskSettingData and Xen_VirtualSystemManagementCapabilities to use new xen session tracing function.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri May 11 13:09:28 2007 -0600 (2007-05-11)
parents d5331bc6ed99
children 1ada37af7d08
files src/Xen_DiskSettingData.c src/Xen_VirtualSystemManagementCapabilities.c
line diff
     1.1 --- a/src/Xen_DiskSettingData.c	Fri May 11 13:05:27 2007 -0600
     1.2 +++ b/src/Xen_DiskSettingData.c	Fri May 11 13:09:28 2007 -0600
     1.3 @@ -123,12 +123,10 @@ static void* beginEnum()
     1.4     
     1.5   Error:
     1.6     if (session && session->xen) {
     1.7 -      char error_msg[XEN_UTILS_ERROR_BUF_LEN];
     1.8 -
     1.9 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    1.10        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    1.11 -                   ("--- failed to retrieve vbd resource from Xend: \"%s\"",
    1.12 -                    error_msg));
    1.13 +                   ("--- failed to retrieve vbd resource from Xend:"));
    1.14 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    1.15 +                            xen_utils_trace_error(session->xen));
    1.16     }
    1.17  
    1.18     xen_vm_record_free(vm_rec);
    1.19 @@ -171,13 +169,10 @@ static void* getNext(void* res_list)
    1.20     /* Get the current disk record. */
    1.21     if (!xen_vbd_get_record(session->xen, &vbd_rec,
    1.22                             resources->disks->contents[resources->currentdisknum])) {
    1.23 -      char error_msg[XEN_UTILS_ERROR_BUF_LEN];
    1.24 -      
    1.25 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    1.26        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    1.27 -                   ("--- failed to retrieve vbd resource from Xend: \"%s\"",
    1.28 -                    error_msg));
    1.29 -      
    1.30 +                   ("--- failed to retrieve vbd resource from Xend:"));
    1.31 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    1.32 +                            xen_utils_trace_error(session->xen));
    1.33        return NULL;
    1.34     }
    1.35     
    1.36 @@ -223,12 +218,10 @@ static int add(void** res_list, void* re
    1.37  
    1.38     xen_vbd new_vbd;
    1.39     if (!xen_vbd_create(session->xen, &new_vbd, new_vbd_rec)) {
    1.40 -      char error_msg[XEN_UTILS_ERROR_BUF_LEN];
    1.41 -      
    1.42 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    1.43        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    1.44 -                   ("--- xen_vbd_create failed: \"%s\"", error_msg));
    1.45 -      
    1.46 +                   ("--- xen_vbd_create failed:"));
    1.47 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    1.48 +                            xen_utils_trace_error(session->xen));
    1.49        return 0;
    1.50     }
    1.51  
    1.52 @@ -253,12 +246,10 @@ static int delete(void** res_list, void*
    1.53     }
    1.54  
    1.55     if (!xen_vbd_destroy(session->xen, vbd_rec->handle)) {
    1.56 -      char error_msg[XEN_UTILS_ERROR_BUF_LEN];
    1.57 -      
    1.58 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    1.59        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    1.60 -                   ("--- xen_vbd_destroy failed: \"%s\"", error_msg));
    1.61 -      
    1.62 +                   ("--- xen_vbd_destroy failed:"));
    1.63 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    1.64 +                            xen_utils_trace_error(session->xen));
    1.65        return 0;
    1.66     }
    1.67  
    1.68 @@ -388,12 +379,10 @@ static int inst2res(CMPIInstance* inst, 
    1.69     }
    1.70  
    1.71     if (!xen_vbd_get_record(session->xen, (xen_vbd_record **)res, (xen_vbd)uuid)) {
    1.72 -      char error_msg[XEN_UTILS_ERROR_BUF_LEN];
    1.73 -      
    1.74 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    1.75        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    1.76 -                   ("--- xen_vbd_destroy failed: \"%s\"", error_msg));
    1.77 -      
    1.78 +                   ("--- xen_vbd_destroy failed:"));
    1.79 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    1.80 +                            xen_utils_trace_error(session->xen));
    1.81        return 0;
    1.82     }
    1.83  
     2.1 --- a/src/Xen_VirtualSystemManagementCapabilities.c	Fri May 11 13:05:27 2007 -0600
     2.2 +++ b/src/Xen_VirtualSystemManagementCapabilities.c	Fri May 11 13:09:28 2007 -0600
     2.3 @@ -98,7 +98,6 @@ static void* getNext(void* res_list)
     2.4  {
     2.5     xen_host host;
     2.6     xen_host_record *host_rec;
     2.7 -   char error_msg[XEN_UTILS_ERROR_BUF_LEN];
     2.8  
     2.9     if (res_list == NULL || ((_RESOURCES *)res_list)->finished)
    2.10        return NULL;
    2.11 @@ -115,10 +114,10 @@ static void* getNext(void* res_list)
    2.12     xen_host_get_record(session->xen, &host_rec, host);
    2.13     if (!session->xen->ok) {
    2.14        /* Error description in session object. */
    2.15 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    2.16        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    2.17 -                   ("--- failed to retrieve host record from Xend: \"%s\"",
    2.18 -                    error_msg));
    2.19 +                   ("--- failed to retrieve host record from Xend:"));
    2.20 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    2.21 +                            xen_utils_trace_error(session->xen));
    2.22        return NULL;
    2.23     }
    2.24        
    2.25 @@ -130,7 +129,6 @@ static int get(void* res_list, void** re
    2.26  {
    2.27     xen_host host;
    2.28     xen_host_record *host_rec;
    2.29 -   char error_msg[XEN_UTILS_ERROR_BUF_LEN];
    2.30  
    2.31     (void) res_list;
    2.32     
    2.33 @@ -143,10 +141,10 @@ static int get(void* res_list, void** re
    2.34     xen_host_get_record(session->xen, &host_rec, host);
    2.35     if (!session->xen->ok) {
    2.36        /* Error description in session object. */
    2.37 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    2.38        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    2.39 -                   ("--- failed to retrieve host record from Xend: \"%s\"",
    2.40 -                    error_msg));
    2.41 +                   ("--- failed to retrieve host record from Xend:"));
    2.42 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    2.43 +                            xen_utils_trace_error(session->xen));
    2.44        return 0;
    2.45     }
    2.46  
    2.47 @@ -274,7 +272,6 @@ static int inst2res(CMPIInstance* inst, 
    2.48  {
    2.49     xen_host host;
    2.50     xen_host_record *host_rec;
    2.51 -   char error_msg[XEN_UTILS_ERROR_BUF_LEN];
    2.52  
    2.53     (void) inst;
    2.54     
    2.55 @@ -292,10 +289,10 @@ static int inst2res(CMPIInstance* inst, 
    2.56     xen_host_get_record(session->xen, &host_rec, host);
    2.57     if (!session->xen->ok) {
    2.58        /* Error description in session object. */
    2.59 -      XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
    2.60        _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_ERROR,
    2.61 -                   ("--- failed to retrieve host record from Xend: \"%s\"",
    2.62 -                    error_msg));
    2.63 +                   ("--- failed to retrieve host record from Xend:"));
    2.64 +      _SBLIM_TRACE_FUNCTION(_SBLIM_TRACE_LEVEL_ERROR,
    2.65 +                            xen_utils_trace_error(session->xen));
    2.66        return 0;
    2.67     }
    2.68