]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device: more informative error log when device isn't found
authorLaine Stump <laine@laine.org>
Wed, 27 May 2015 17:59:57 +0000 (13:59 -0400)
committerLaine Stump <laine@laine.org>
Thu, 28 May 2015 16:48:45 +0000 (12:48 -0400)
In a couple of cases, the node device driver (and the test node device
driver which likely copied it) was only logging "Node device not
found" when it couldn't find the requested device. This patch changes
those cases to log the name (and in the case when it's relevant, the
wwnn and wwpn) as well.

src/node_device/node_device_driver.c
src/test/test_driver.c

index 34ba1fad278d498200455d5a000d58e76b54ceda..768db7fbb353861ee53c0a91df38fe8d8bafd636 100644 (file)
@@ -248,7 +248,9 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name)
     nodeDeviceUnlock();
 
     if (!obj) {
-        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       name);
         goto cleanup;
     }
 
@@ -597,8 +599,10 @@ nodeDeviceCreateXML(virConnectPtr conn,
      * we're returning what we get... */
 
     if (dev == NULL)
-        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
-
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device for '%s' with matching "
+                         "wwnn '%s' and wwpn '%s'"),
+                       def->name, wwnn, wwpn);
  cleanup:
     nodeDeviceUnlock();
     virNodeDeviceDefFree(def);
@@ -621,7 +625,9 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
     nodeDeviceUnlock();
 
     if (!obj) {
-        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       dev->name);
         goto out;
     }
 
index 038b2b89bdf9dc1e303e987c16f0757368a009bb..d1f0af3a952f47a26e0d83d334176e16dcd6f2e0 100644 (file)
@@ -5673,7 +5673,9 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name)
     testDriverUnlock(driver);
 
     if (!obj) {
-        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       name);
         goto cleanup;
     }
 
@@ -5893,7 +5895,9 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
     testDriverUnlock(driver);
 
     if (!obj) {
-        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       dev->name);
         goto out;
     }