]> xenbits.xensource.com Git - libvirt.git/commitdiff
nodedev: mdev: Report an error when mdev path resolution fails
authorErik Skultety <eskultet@redhat.com>
Tue, 20 Jun 2017 14:50:26 +0000 (16:50 +0200)
committerErik Skultety <eskultet@redhat.com>
Thu, 17 Aug 2017 14:50:47 +0000 (16:50 +0200)
It might happen that virFileResolveLinkHelper fails on the lstat system
call. virFileResolveLink expects the caller to report an error when it
fails, however this wasn't the case for udevProcessMediatedDevice.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
src/node_device/node_device_udev.c

index 4c35fd5c981df6f82a639598eb1e9fe5bcfeb45e..0944b41d76392ed120fcc6559919e7631d7a3f3b 100644 (file)
@@ -1121,8 +1121,10 @@ udevProcessMediatedDevice(struct udev_device *dev,
     if (virAsprintf(&linkpath, "%s/mdev_type", udev_device_get_syspath(dev)) < 0)
         goto cleanup;
 
-    if (virFileResolveLink(linkpath, &canonicalpath) < 0)
+    if (virFileResolveLink(linkpath, &canonicalpath) < 0) {
+        virReportSystemError(errno, _("failed to resolve '%s'"), linkpath);
         goto cleanup;
+    }
 
     if (VIR_STRDUP(data->type, last_component(canonicalpath)) < 0)
         goto cleanup;