[PATCH] util: set error if DAD is not finished

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

 



If DAD not finished in 5 seconds, user will get an
unknown error like this:

 # virsh net-start ipv6
 error: Failed to start network ipv6
 error: An error occurred, but the cause is unknown

Call virReportError to set an error.

Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
---
I found the DAD will take 7 seconds
on my machine, and i cannot create a network which
use ipv6 now :( . Can we offer a way allow user to change this
timeout ? maybe add a configuration file option in
libvirtd.conf.

 src/util/virnetdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 9789e93..c8861e9 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1398,7 +1398,13 @@ virNetDevWaitDadFinish(virSocketAddrPtr *addrs, size_t count)
         VIR_FREE(resp);
     }
     /* Check timeout. */
-    ret = dad ? -1 : 0;
+    if (dad) {
+        virReportError(VIR_ERR_SYSTEM_ERROR,
+                       _("Duplicate Address Detection "
+                         "not finished in %d seconds"), VIR_DAD_WAIT_TIMEOUT);
+    } else {
+        ret = 0;
+    }
 
  cleanup:
     VIR_FREE(resp);
-- 
1.8.3.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]