提交 a7035662 编写于 作者: O Osier Yang

util: Use virReportSystemError for system error in pci.c

上级 3d77b98c
...@@ -1860,10 +1860,9 @@ pciGetPciConfigAddressFromSysfsDeviceLink(const char *device_link, ...@@ -1860,10 +1860,9 @@ pciGetPciConfigAddressFromSysfsDeviceLink(const char *device_link,
device_path = canonicalize_file_name(device_link); device_path = canonicalize_file_name(device_link);
if (device_path == NULL) { if (device_path == NULL) {
memset(errbuf, '\0', sizeof(errbuf)); memset(errbuf, '\0', sizeof(errbuf));
virReportError(VIR_ERR_INTERNAL_ERROR, virReportSystemError(errno,
_("Failed to resolve device link '%s': '%s'"), _("Failed to resolve device link '%s'"),
device_link, virStrerror(errno, errbuf, device_link);
sizeof(errbuf)));
return ret; return ret;
} }
...@@ -1941,10 +1940,9 @@ pciGetVirtualFunctions(const char *sysfs_path, ...@@ -1941,10 +1940,9 @@ pciGetVirtualFunctions(const char *sysfs_path,
dir = opendir(sysfs_path); dir = opendir(sysfs_path);
if (dir == NULL) { if (dir == NULL) {
memset(errbuf, '\0', sizeof(errbuf)); memset(errbuf, '\0', sizeof(errbuf));
virReportError(VIR_ERR_INTERNAL_ERROR, virReportSystemError(errno,
_("Failed to open dir '%s': '%s'"), _("Failed to open dir '%s'"),
sysfs_path, virStrerror(errno, errbuf, sysfs_path);
sizeof(errbuf)));
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册