]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
util: set error if DAD is not finished
authorLuyao Huang <lhuang@redhat.com>
Thu, 29 Oct 2015 09:47:33 +0000 (17:47 +0800)
committerLaine Stump <laine@laine.org>
Thu, 29 Oct 2015 18:19:56 +0000 (14:19 -0400)
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@redhat.com>
src/util/virnetdev.c

index 9789e930a9324dad7a65ac8232b6f40bf168e4c1..c8861e979ff4a544e6aaff7ebc59bc1e3c14d419 100644 (file)
@@ -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);