Better abstract OpenFlow error codes.
[openvswitch] / lib / dpif.c
index a01b998c30874d3636682db265b716f962f6f7ca..ecafac1ac2a68ad0a181e8c580dcc2643f4b2b24 100644 (file)
@@ -30,6 +30,7 @@
 #include "netdev.h"
 #include "netlink.h"
 #include "odp-util.h"
+#include "ofp-errors.h"
 #include "ofp-print.h"
 #include "ofp-util.h"
 #include "ofpbuf.h"
@@ -1200,13 +1201,12 @@ log_operation(const struct dpif *dpif, const char *operation, int error)
 {
     if (!error) {
         VLOG_DBG_RL(&dpmsg_rl, "%s: %s success", dpif_name(dpif), operation);
-    } else if (is_errno(error)) {
+    } else if (ofperr_is_valid(error)) {
         VLOG_WARN_RL(&error_rl, "%s: %s failed (%s)",
-                     dpif_name(dpif), operation, strerror(error));
+                     dpif_name(dpif), operation, ofperr_get_name(error));
     } else {
-        VLOG_WARN_RL(&error_rl, "%s: %s failed (%d/%d)",
-                     dpif_name(dpif), operation,
-                     get_ofp_err_type(error), get_ofp_err_code(error));
+        VLOG_WARN_RL(&error_rl, "%s: %s failed (%s)",
+                     dpif_name(dpif), operation, strerror(error));
     }
 }