]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: fix error messages in virNetlinkEventServiceStart
authorLaine Stump <laine@laine.org>
Thu, 26 Apr 2012 18:35:26 +0000 (14:35 -0400)
committerLaine Stump <laine@laine.org>
Thu, 26 Apr 2012 19:24:07 +0000 (15:24 -0400)
Some of the error messages in this function should have been
virReportSystemError (since they have an errno they want to log), but
were mistakenly written as netlinkError, which expects a libvirt error
code instead. The result was that when one of the errors was
encountered, "No error message provided" would be printed instead of
something meaningful (see
https://bugzilla.redhat.com/show_bug.cgi?id=816465 for an example).

src/util/virnetlink.c

index 7017275b4b0ec9a1382b17cdae987224cbcef29f..b2e9d518d08d00c640928f7417a95fa4b232d988 100644 (file)
@@ -238,8 +238,8 @@ virNetlinkEventCallback(int watch,
     if (length == 0)
         return;
     if (length < 0) {
-        netlinkError(errno,
-                     "%s", _("nl_recv returned with error"));
+        virReportSystemError(errno,
+                             "%s", _("nl_recv returned with error"));
         return;
     }
 
@@ -349,28 +349,28 @@ virNetlinkEventServiceStart(void)
     srv->netlinknh = nl_handle_alloc();
 
     if (!srv->netlinknh) {
-        netlinkError(errno,
-                "%s", _("cannot allocate nlhandle for virNetlinkEvent server"));
+        virReportSystemError(errno,
+                             "%s", _("cannot allocate nlhandle for virNetlinkEvent server"));
         goto error_locked;
     }
 
     if (nl_connect(srv->netlinknh, NETLINK_ROUTE) < 0) {
-        netlinkError(errno,
-                "%s", _("cannot connect to netlink socket"));
+        virReportSystemError(errno,
+                             "%s", _("cannot connect to netlink socket"));
         goto error_server;
     }
 
     fd = nl_socket_get_fd(srv->netlinknh);
 
     if (fd < 0) {
-        netlinkError(errno,
-                     "%s", _("cannot get netlink socket fd"));
+        virReportSystemError(errno,
+                             "%s", _("cannot get netlink socket fd"));
         goto error_server;
     }
 
     if (nl_socket_set_nonblocking(srv->netlinknh)) {
-        netlinkError(errno, "%s",
-                     _("cannot set netlink socket nonblocking"));
+        virReportSystemError(errno, "%s",
+                             _("cannot set netlink socket nonblocking"));
         goto error_server;
     }