]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
maint: fix some compilation issues on non-linux platforms
authorStefan Berger <stefanb@us.ibm.com>
Tue, 16 Aug 2011 17:54:15 +0000 (13:54 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 16 Aug 2011 17:54:15 +0000 (13:54 -0400)
This patch fixes *some* compilation issues on non-Linux platforms (cygwin).

src/util/interface.c
src/util/pci.c
src/util/virfile.c

index aec12f5ebf2c6c756e28817d0cb8d752bb514ce0..5d473b751007b6d0bb1e3be21685f5d087f4f3e3 100644 (file)
@@ -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 "
index 7040e5532348c0b7580e5bf113b00b6781d708b5..9873f33eee96f56b80de9aee3110f6c942ac01e9 100644 (file)
@@ -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"));
index 0edf05875da7d2148b4bbae858028c8e14ab2dc8..11589988c021d1a9663a6a184ee86acf5dfa9d15 100644 (file)
@@ -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) {