]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
util: Use virReportSystemError for system error in pci.c
authorOsier Yang <jyang@redhat.com>
Fri, 23 Nov 2012 08:02:07 +0000 (16:02 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 26 Nov 2012 01:59:04 +0000 (09:59 +0800)
src/util/pci.c

index d1ad121743b315331d5481d85b242da840efa75e..191f99dc9f1d151f9942b229caa325ca1506b3ee 100644 (file)
@@ -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;
     }