mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
maint: fix some compilation issues on non-linux platforms
This patch fixes *some* compilation issues on non-Linux platforms (cygwin).
This commit is contained in:
parent
6452b1eb5c
commit
f4765b691d
@ -1317,7 +1317,7 @@ ifaceGetPhysicalFunction(const char *ifname, char **pfname)
|
||||
}
|
||||
#else
|
||||
int
|
||||
ifaceIsVirtualFunction(const char *ifname)
|
||||
ifaceIsVirtualFunction(const char *ifname ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("ifaceIsVirtualFunction is not supported on non-linux "
|
||||
@ -1326,8 +1326,9 @@ ifaceIsVirtualFunction(const char *ifname)
|
||||
}
|
||||
|
||||
int
|
||||
ifaceGetVirtualFunctionIndex(const char *pfname, const char *vfname,
|
||||
int *vf_index)
|
||||
ifaceGetVirtualFunctionIndex(const char *pfname ATTRIBUTE_UNUSED,
|
||||
const char *vfname ATTRIBUTE_UNUSED,
|
||||
int *vf_index ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("ifaceGetVirtualFunctionIndex is not supported on non-linux "
|
||||
@ -1336,7 +1337,8 @@ ifaceGetVirtualFunctionIndex(const char *pfname, const char *vfname,
|
||||
}
|
||||
|
||||
int
|
||||
ifaceGetPhysicalFunction(const char *ifname, char **pfname)
|
||||
ifaceGetPhysicalFunction(const char *ifname ATTRIBUTE_UNUSED,
|
||||
char **pfname ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("ifaceGetPhysicalFunction is not supported on non-linux "
|
||||
|
@ -1685,6 +1685,8 @@ int pciDeviceIsAssignable(pciDevice *dev,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
/*
|
||||
* returns 1 if equal and 0 if not
|
||||
*/
|
||||
@ -1804,7 +1806,6 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
/*
|
||||
* Returns Physical function given a virtual function
|
||||
*/
|
||||
@ -2010,8 +2011,8 @@ out:
|
||||
}
|
||||
#else
|
||||
int
|
||||
pciGetPhysicalFunction(const char *vf_sysfs_path,
|
||||
struct pci_config_address **physical_function)
|
||||
pciGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED,
|
||||
struct pci_config_address **physical_function ATTRIBUTE_UNUSED)
|
||||
{
|
||||
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetPhysicalFunction is not "
|
||||
"supported on non-linux platforms"));
|
||||
@ -2019,9 +2020,9 @@ pciGetPhysicalFunction(const char *vf_sysfs_path,
|
||||
}
|
||||
|
||||
int
|
||||
pciGetVirtualFunctions(const char *sysfs_path,
|
||||
struct pci_config_address ***virtual_functions,
|
||||
unsigned int *num_virtual_functions)
|
||||
pciGetVirtualFunctions(const char *sysfs_path ATTRIBUTE_UNUSED,
|
||||
struct pci_config_address ***virtual_functions ATTRIBUTE_UNUSED,
|
||||
unsigned int *num_virtual_functions ATTRIBUTE_UNUSED)
|
||||
{
|
||||
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetVirtualFunctions is not "
|
||||
"supported on non-linux platforms"));
|
||||
@ -2029,7 +2030,7 @@ pciGetVirtualFunctions(const char *sysfs_path,
|
||||
}
|
||||
|
||||
int
|
||||
pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link)
|
||||
pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link ATTRIBUTE_UNUSED)
|
||||
{
|
||||
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciDeviceIsVirtualFunction is "
|
||||
"not supported on non-linux platforms"));
|
||||
@ -2037,9 +2038,9 @@ pciDeviceIsVirtualFunction(const char *vf_sysfs_device_link)
|
||||
}
|
||||
|
||||
int
|
||||
pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
|
||||
const char *vf_sysfs_device_link,
|
||||
int *vf_index)
|
||||
pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link ATTRIBUTE_UNUSED,
|
||||
const char *vf_sysfs_device_link ATTRIBUTE_UNUSED,
|
||||
int *vf_index ATTRIBUTE_UNUSED)
|
||||
{
|
||||
pciReportError(VIR_ERR_INTERNAL_ERROR, _("pciGetVirtualFunctionIndex is "
|
||||
"not supported on non-linux platforms"));
|
||||
@ -2048,7 +2049,8 @@ pciGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
|
||||
}
|
||||
|
||||
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 "
|
||||
"supported on non-linux platforms"));
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
int virFileClose(int *fdptr, bool preserve_errno)
|
||||
{
|
||||
int saved_errno;
|
||||
int saved_errno = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (*fdptr >= 0) {
|
||||
@ -62,7 +62,7 @@ int virFileClose(int *fdptr, bool preserve_errno)
|
||||
|
||||
int virFileFclose(FILE **file, bool preserve_errno)
|
||||
{
|
||||
int saved_errno;
|
||||
int saved_errno = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (*file) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user