[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] maint: update list of error function names and adapt



I updated the list of error function names
in Makefile.maint, and exposed 3 more unmarked diagnostics.
Going through the old/new lists, I also found two
now-unused (#define'd) "functions".

I originally did this on top of Dan's patch series,
but it also applies to the trunk, modulo some offset differences
in xen_unified.c.


>From 8124c5ae693fdad477df6b38dc5b75b4cd8f36cf Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering redhat com>
Date: Mon, 19 Jan 2009 09:25:02 +0100
Subject: [PATCH] maint: update list of error function names and adapt

* Makefile.maint (msg_gen_function): Update list.
Remove some now-unused names, add some new ones.
* src/hash.c (virHashError): Remove unused definition.
* src/openvz_conf.h (openvzLog): Likewise.
* src/xen_unified.c: Mark newly-exposed diagnostics for translation.
---
 Makefile.maint    |    8 ++++----
 src/hash.c        |    5 -----
 src/openvz_conf.h |    8 --------
 src/xen_unified.c |    8 ++++----
 4 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/Makefile.maint b/Makefile.maint
index 2ac6dd7..35eddd1 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -390,6 +390,7 @@ msg_gen_function += ERROR0
 msg_gen_function += REMOTE_DEBUG
 msg_gen_function += ReportError
 msg_gen_function += VIR_FREE
+msg_gen_function += VIR_INFO
 msg_gen_function += VIR_USE_CPU
 msg_gen_function += errorf
 msg_gen_function += lxcError
@@ -401,9 +402,7 @@ msg_gen_function += qemudDispatchClientFailure
 msg_gen_function += qemudLog
 msg_gen_function += qemudReportError
 msg_gen_function += regerror
-msg_gen_function += remoteDispatchError
 msg_gen_function += remoteDispatchFormatError
-msg_gen_function += umlError
 msg_gen_function += umlLog
 msg_gen_function += umlReportError
 msg_gen_function += virConfError
@@ -414,18 +413,19 @@ msg_gen_function += virLibDomainError
 msg_gen_function += virLog
 msg_gen_function += virNetworkReportError
 msg_gen_function += virNodeDeviceReportError
+msg_gen_function += virProxyError
 msg_gen_function += virRaiseError
 msg_gen_function += virReportErrorHelper
+msg_gen_function += virReportSystemError
 msg_gen_function += virSexprError
 msg_gen_function += virStorageLog
 msg_gen_function += virStorageReportError
-msg_gen_function += virTestError
 msg_gen_function += virXMLError
 msg_gen_function += virXenInotifyError
 msg_gen_function += virXenStoreError
 msg_gen_function += virXendError
-msg_gen_function += virxmlRpcError
 msg_gen_function += vshCloseLogFile
+msg_gen_function += xenUnifiedError
 msg_gen_function += xenXMError

 # Uncomment the following and run "make syntax-check" to see diagnostics
diff --git a/src/hash.c b/src/hash.c
index b960640..bde3a0b 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -32,10 +32,6 @@

 /* #define DEBUG_GROW */

-#define virHashError(conn, code, fmt...)                                   \
-        virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__,        \
-                               __FUNCTION__, __LINE__, fmt)
-
 /*
  * A single entry in the hash table
  */
@@ -593,4 +589,3 @@ void *virHashSearch(virHashTablePtr table, virHashSearcher iter, const void *dat
     }
     return (NULL);
 }
-
diff --git a/src/openvz_conf.h b/src/openvz_conf.h
index 1030d17..8e02056 100644
--- a/src/openvz_conf.h
+++ b/src/openvz_conf.h
@@ -34,14 +34,6 @@

 enum { OPENVZ_WARN, OPENVZ_ERR };

-#define openvzLog(level, msg...) { if(level == OPENVZ_WARN) \
-                                        fprintf(stderr, "\nWARNING: ");\
-                                else \
-                                        fprintf(stderr, "\nERROR: ");\
-                                fprintf(stderr, "\n\t");\
-                                fprintf(stderr, msg);\
-                                fprintf(stderr, "\n"); }
-
 #define openvzError(conn, code, fmt...)                                      \
         virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__,        \
                                __FUNCTION__, __LINE__, fmt)
diff --git a/src/xen_unified.c b/src/xen_unified.c
index e0a446a..66d5fc2 100644
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -1,7 +1,7 @@
 /*
  * xen_unified.c: Unified Xen driver.
  *
- * Copyright (C) 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2007, 2008, 2009 Red Hat, Inc.
  *
  * See COPYING.LIB for the License of this software
  *
@@ -235,7 +235,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)

     /* Allocate per-connection private data. */
     if (VIR_ALLOC(priv) < 0) {
-        xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, "allocating private data");
+        xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, _("allocating private data"));
         return VIR_DRV_OPEN_ERROR;
     }
     if (virMutexInit(&priv->lock) < 0) {
@@ -247,7 +247,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)

     /* Allocate callback list */
     if (VIR_ALLOC(cbList) < 0) {
-        xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, "allocating callback list");
+        xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, _("allocating callback list"));
         virMutexDestroy(&priv->lock);
         VIR_FREE(priv);
         return VIR_DRV_OPEN_ERROR;
@@ -1533,7 +1533,7 @@ xenUnifiedAddDomainInfo(xenUnifiedDomainInfoListPtr list,
     list->count++;
     return 0;
 memory_error:
-    xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, "allocating domain info");
+    xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, _("allocating domain info"));
     if (info)
         VIR_FREE(info->name);
     VIR_FREE(info);
--
1.6.1.258.g7ff14


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]