[ovs-dev] [PATCH 13/21] dpif_dummy_override: Allow overriding a non-existing provider

YAMAMOTO Takashi yamamoto at midokura.com
Mon Oct 19 04:29:04 UTC 2015


This allows --enable-dummy=system with a userland-only build.
It's useful for testsuite.

Signed-off-by: YAMAMOTO Takashi <yamamoto at midokura.com>
---
 lib/dpif-netdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 47fa9e2..4dcfded 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3786,7 +3786,14 @@ dpif_dummy_register__(const char *type)
 static void
 dpif_dummy_override(const char *type)
 {
-    if (!dp_unregister_provider(type)) {
+    int error;
+
+    /*
+     * Ignore EAFNOSUPPORT to allow --enable-dummy=system with
+     * a userland-only build.  It's useful for testsuite.
+     */
+    error = dp_unregister_provider(type);
+    if (error == 0 || error == EAFNOSUPPORT) {
         dpif_dummy_register__(type);
     }
 }
-- 
2.3.8 (Apple Git-58)




More information about the dev mailing list