[PATCHv2 06/10] virterror: clean up VIR_ERR_HTTP_ERROR usage

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

 



* src/util/virterror.c (virErrorMsg): Unify semantics.
* src/xen/xend_internal.c (virXendErrorInt): Delete unused macro.
(http2unix): Reduce indirection in error report.
* cfg.mk (sc_libvirt_unmarked_diagnostics): Relax filter.
---

The cfg.mk change was a better alternative than forcing
translators to deal with _("%d").

 cfg.mk                  |    3 ++-
 src/util/virterror.c    |    4 +---
 src/xen/xend_internal.c |    5 +----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index f5051d4..2aebf9b 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -228,6 +228,7 @@ func_re := ($(func_or))
 # The sed filters eliminate false-positives like these:
 #    _("...: "
 #    "%s", _("no storage vol w..."
+#    "%d", value
 sc_libvirt_unmarked_diagnostics:
 	@grep -nE							\
 	    '\<$(func_re) *\([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT))	\
@@ -236,7 +237,7 @@ sc_libvirt_unmarked_diagnostics:
 	    exit 1; } || :
 	@{ grep     -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT));   \
 	   grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
-	   | sed 's/_("[^"][^"]*"//;s/[	 ]"%s"//'			\
+	   | sed 's/_("[^"][^"]*"//;s/[	 ]"%[sd]"//'			\
 	   | grep '[	 ]"' &&						\
 	  { echo '$(ME): found unmarked diagnostic(s)' 1>&2;		\
 	    exit 1; } || :
diff --git a/src/util/virterror.c b/src/util/virterror.c
index 00da698..8ec9d97 100644
--- a/src/util/virterror.c
+++ b/src/util/virterror.c
@@ -800,9 +800,7 @@ virErrorMsg(virErrorNumber error, const char *info)
             errmsg = _("POST operation failed");
             break;
         case VIR_ERR_HTTP_ERROR:
-            /* FIXME: Adjust all callers before unifying semantics.  */
-            errmsg = _("got unknown HTTP error code %d");
-            info = NULL;
+            errmsg = _("got unknown HTTP error code");
             break;
         case VIR_ERR_UNKNOWN_HOST:
             errmsg = _("unknown host");
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index ea5addd..a28fb0e 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -101,9 +101,6 @@ virDomainXMLDevID(virDomainPtr domain,
         virReportErrorHelper(NULL, VIR_FROM_XEND, code, __FILE__,          \
                              __FUNCTION__, __LINE__, __VA_ARGS__)

-#define virXendErrorInt(code, ival)                                        \
-        virXendError(code, "%d", ival)
-
 /**
  * do_connect:
  * @xend: pointer to the Xen Daemon structure
@@ -475,7 +472,7 @@ http2unix(int ret)
             errno = EIO;
             break;
         default:
-            virXendErrorInt(VIR_ERR_HTTP_ERROR, ret);
+            virXendError(VIR_ERR_HTTP_ERROR, "%d", ret);
             errno = EINVAL;
             break;
     }
-- 
1.7.0.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]