[PATCH] util: Use virReportSystemError for system error in pci.c

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

 



---
 src/util/pci.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/util/pci.c b/src/util/pci.c
index d1ad121..191f99d 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -1860,10 +1860,9 @@ pciGetPciConfigAddressFromSysfsDeviceLink(const char *device_link,
     device_path = canonicalize_file_name(device_link);
     if (device_path == NULL) {
         memset(errbuf, '\0', sizeof(errbuf));
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to resolve device link '%s': '%s'"),
-                       device_link, virStrerror(errno, errbuf,
-                       sizeof(errbuf)));
+        virReportSystemError(errno,
+                             _("Failed to resolve device link '%s'"),
+                             device_link);
         return ret;
     }
 
@@ -1941,10 +1940,9 @@ pciGetVirtualFunctions(const char *sysfs_path,
     dir = opendir(sysfs_path);
     if (dir == NULL) {
         memset(errbuf, '\0', sizeof(errbuf));
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to open dir '%s': '%s'"),
-                       sysfs_path, virStrerror(errno, errbuf,
-                       sizeof(errbuf)));
+        virReportSystemError(errno,
+                             _("Failed to open dir '%s'"),
+                             sysfs_path);
         return ret;
     }
 
-- 
1.7.7.6

--
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]