提交 f4765b69 编写于 作者: S Stefan Berger

maint: fix some compilation issues on non-linux platforms

This patch fixes *some* compilation issues on non-Linux platforms (cygwin).
上级 6452b1eb
...@@ -1317,7 +1317,7 @@ ifaceGetPhysicalFunction(const char *ifname, char **pfname) ...@@ -1317,7 +1317,7 @@ ifaceGetPhysicalFunction(const char *ifname, char **pfname)
} }
#else #else
int int
ifaceIsVirtualFunction(const char *ifname) ifaceIsVirtualFunction(const char *ifname ATTRIBUTE_UNUSED)
{ {
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s", ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
_("ifaceIsVirtualFunction is not supported on non-linux " _("ifaceIsVirtualFunction is not supported on non-linux "
...@@ -1326,8 +1326,9 @@ ifaceIsVirtualFunction(const char *ifname) ...@@ -1326,8 +1326,9 @@ ifaceIsVirtualFunction(const char *ifname)
} }
int int
ifaceGetVirtualFunctionIndex(const char *pfname, const char *vfname, ifaceGetVirtualFunctionIndex(const char *pfname ATTRIBUTE_UNUSED,
int *vf_index) const char *vfname ATTRIBUTE_UNUSED,
int *vf_index ATTRIBUTE_UNUSED)
{ {
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s", ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
_("ifaceGetVirtualFunctionIndex is not supported on non-linux " _("ifaceGetVirtualFunctionIndex is not supported on non-linux "
...@@ -1336,7 +1337,8 @@ ifaceGetVirtualFunctionIndex(const char *pfname, const char *vfname, ...@@ -1336,7 +1337,8 @@ ifaceGetVirtualFunctionIndex(const char *pfname, const char *vfname,
} }
int int
ifaceGetPhysicalFunction(const char *ifname, char **pfname) ifaceGetPhysicalFunction(const char *ifname ATTRIBUTE_UNUSED,
char **pfname ATTRIBUTE_UNUSED)
{ {
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s", ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
_("ifaceGetPhysicalFunction is not supported on non-linux " _("ifaceGetPhysicalFunction is not supported on non-linux "
......
...@@ -1685,6 +1685,8 @@ int pciDeviceIsAssignable(pciDevice *dev, ...@@ -1685,6 +1685,8 @@ int pciDeviceIsAssignable(pciDevice *dev,
return 1; return 1;
} }
#ifdef __linux__
/* /*
* returns 1 if equal and 0 if not * returns 1 if equal and 0 if not
*/ */
...@@ -1804,7 +1806,6 @@ out: ...@@ -1804,7 +1806,6 @@ out:
return ret; return ret;
} }
#ifdef __linux__
/* /*
* Returns Physical function given a virtual function * Returns Physical function given a virtual function
*/ */
...@@ -2010,8 +2011,8 @@ out: ...@@ -2010,8 +2011,8 @@ out:
} }
#else #else
int int
pciGetPhysicalFunction(const char *vf_sysfs_path, pciGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED,
struct pci_config_address **physical_function) struct pci_config_address **physical_function ATTRIBUTE_UNUSED)
{ {
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetPhysicalFunction is not " pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetPhysicalFunction is not "
"supported on non-linux platforms")); "supported on non-linux platforms"));
...@@ -2019,9 +2020,9 @@ pciGetPhysicalFunction(const char *vf_sysfs_path, ...@@ -2019,9 +2020,9 @@ pciGetPhysicalFunction(const char *vf_sysfs_path,
} }
int int
pciGetVirtualFunctions(const char *sysfs_path, pciGetVirtualFunctions(const char *sysfs_path ATTRIBUTE_UNUSED,
struct pci_config_address ***virtual_functions, struct pci_config_address ***virtual_functions ATTRIBUTE_UNUSED,
unsigned int *num_virtual_functions) unsigned int *num_virtual_functions ATTRIBUTE_UNUSED)
{ {
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetVirtualFunctions is not " pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetVirtualFunctions is not "
"supported on non-linux platforms")); "supported on non-linux platforms"));
...@@ -2029,7 +2030,7 @@ pciGetVirtualFunctions(const char *sysfs_path, ...@@ -2029,7 +2030,7 @@ pciGetVirtualFunctions(const char *sysfs_path,
} }
int int
pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link) pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link ATTRIBUTE_UNUSED)
{ {
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciDeviceIsVirtualFunction is " pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciDeviceIsVirtualFunction is "
"not supported on non-linux platforms")); "not supported on non-linux platforms"));
...@@ -2037,9 +2038,9 @@ pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link) ...@@ -2037,9 +2038,9 @@ pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link)
} }
int int
pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link, pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link ATTRIBUTE_UNUSED,
const char *vf_sysfs_device_link, const char *vf_sysfs_device_link ATTRIBUTE_UNUSED,
int *vf_index) int *vf_index ATTRIBUTE_UNUSED)
{ {
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetVirtualFunctionIndex is " pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetVirtualFunctionIndex is "
"not supported on non-linux platforms")); "not supported on non-linux platforms"));
...@@ -2048,7 +2049,8 @@ pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link, ...@@ -2048,7 +2049,8 @@ pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
} }
int int
pciDeviceNetName(char *device_link_sysfs_path, char **netname) pciDeviceNetName(char *device_link_sysfs_path ATTRIBUTE_UNUSED,
char **netname ATTRIBUTE_UNUSED)
{ {
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciDeviceNetName is not " pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciDeviceNetName is not "
"supported on non-linux platforms")); "supported on non-linux platforms"));
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
int virFileClose(int *fdptr, bool preserve_errno) int virFileClose(int *fdptr, bool preserve_errno)
{ {
int saved_errno; int saved_errno = 0;
int rc = 0; int rc = 0;
if (*fdptr >= 0) { if (*fdptr >= 0) {
...@@ -62,7 +62,7 @@ int virFileClose(int *fdptr, bool preserve_errno) ...@@ -62,7 +62,7 @@ int virFileClose(int *fdptr, bool preserve_errno)
int virFileFclose(FILE **file, bool preserve_errno) int virFileFclose(FILE **file, bool preserve_errno)
{ {
int saved_errno; int saved_errno = 0;
int rc = 0; int rc = 0;
if (*file) { if (*file) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册