]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: use size_t instead of unsigned int for num_virtual_functions
authorLaine Stump <laine@laine.org>
Fri, 8 Nov 2013 10:39:08 +0000 (12:39 +0200)
committerLaine Stump <laine@laine.org>
Fri, 8 Nov 2013 12:31:11 +0000 (14:31 +0200)
This is a prerequisite to the fix for the fix to:

  https://bugzilla.redhat.com/show_bug.cgi?id=1025397

num_virtual_functions needs to be size_t in order to use the
VIR_APPEND_ELEMENT macro.

src/conf/node_device_conf.h
src/network/bridge_driver.c
src/util/virnetdev.c
src/util/virnetdev.h
src/util/virpci.c
src/util/virpci.h

index af8fedc1e0109118602ba3b0fc60b525b93f04a6..9f3abe7d359aac75bc10d36802acdb91ef7bc0d1 100644 (file)
@@ -110,7 +110,7 @@ struct _virNodeDevCapsDef {
             char *vendor_name;
             virPCIDeviceAddressPtr physical_function;
             virPCIDeviceAddressPtr *virtual_functions;
-            unsigned int num_virtual_functions;
+            size_t num_virtual_functions;
             unsigned int flags;
             virPCIDeviceAddressPtr *iommuGroupDevices;
             size_t nIommuGroupDevices;
index 41edb97eebebf6a8d3d026c17351b582c0625b77..3423a45fe1f3254d47073cb9d956c5db585da558 100644 (file)
@@ -3046,7 +3046,7 @@ int networkRegister(void) {
  */
 static int
 networkCreateInterfacePool(virNetworkDefPtr netdef) {
-    unsigned int num_virt_fns = 0;
+    size_t num_virt_fns = 0;
     char **vfname = NULL;
     virPCIDeviceAddressPtr *virt_fns;
     int ret = -1;
index 441b171d460fd276feeafafbf1bb0592a5718f5f..e74fc5fccdf7f9c09890a0a0c3c792cb060714cc 100644 (file)
@@ -1104,7 +1104,7 @@ int
 virNetDevGetVirtualFunctions(const char *pfname,
                              char ***vfname,
                              virPCIDeviceAddressPtr **virt_fns,
-                             unsigned int *n_vfname)
+                             size_t *n_vfname)
 {
     int ret = -1;
     size_t i;
@@ -1291,7 +1291,7 @@ int
 virNetDevGetVirtualFunctions(const char *pfname ATTRIBUTE_UNUSED,
                              char ***vfname ATTRIBUTE_UNUSED,
                              virPCIDeviceAddressPtr **virt_fns ATTRIBUTE_UNUSED,
-                             unsigned int *n_vfname ATTRIBUTE_UNUSED)
+                             size_t *n_vfname ATTRIBUTE_UNUSED)
 {
     virReportSystemError(ENOSYS, "%s",
                          _("Unable to get virtual functions on this platform"));
index 8e9ee2d79f62416861229ab6cbb4cd1209639638..0aa5dc706df58cf4ff01a3e127069c1efc8b748c 100644 (file)
@@ -124,7 +124,7 @@ int virNetDevGetPhysicalFunction(const char *ifname, char **pfname)
 int virNetDevGetVirtualFunctions(const char *pfname,
                                  char ***vfname,
                                  virPCIDeviceAddressPtr **virt_fns,
-                                 unsigned int *n_vfname)
+                                 size_t *n_vfname)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
     ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
 
index 148631f506975ca3864fac6a613d09b7d90cd3b3..0fe55442e583b3fa89634b0265ef4aee2afb7ce9 100644 (file)
@@ -2385,7 +2385,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path,
 int
 virPCIGetVirtualFunctions(const char *sysfs_path,
                           virPCIDeviceAddressPtr **virtual_functions,
-                          unsigned int *num_virtual_functions)
+                          size_t *num_virtual_functions)
 {
     int ret = -1;
     size_t i;
@@ -2418,7 +2418,7 @@ virPCIGetVirtualFunctions(const char *sysfs_path,
                 goto error;
             }
 
-            VIR_DEBUG("Number of virtual functions: %d",
+            VIR_DEBUG("Number of virtual functions: %zu",
                       *num_virtual_functions);
 
             if (virPCIGetDeviceAddressFromSysfsLink(device_link,
@@ -2489,7 +2489,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
 {
     int ret = -1;
     size_t i;
-    unsigned int num_virt_fns = 0;
+    size_t num_virt_fns = 0;
     virPCIDeviceAddressPtr vf_bdf = NULL;
     virPCIDeviceAddressPtr *virt_fns = NULL;
 
@@ -2634,7 +2634,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED,
 int
 virPCIGetVirtualFunctions(const char *sysfs_path ATTRIBUTE_UNUSED,
                           virPCIDeviceAddressPtr **virtual_functions ATTRIBUTE_UNUSED,
-                          unsigned int *num_virtual_functions ATTRIBUTE_UNUSED)
+                          size_t *num_virtual_functions ATTRIBUTE_UNUSED)
 {
     virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
     return -1;
index 0aa6feeeb34dc9569467a7aa72baaab7e159f58c..0479f0bc202b5cf540cb6574adec667c9c1815b1 100644 (file)
@@ -138,7 +138,7 @@ int virPCIGetPhysicalFunction(const char *sysfs_path,
 
 int virPCIGetVirtualFunctions(const char *sysfs_path,
                               virPCIDeviceAddressPtr **virtual_functions,
-                              unsigned int *num_virtual_functions);
+                              size_t *num_virtual_functions);
 
 int virPCIIsVirtualFunction(const char *vf_sysfs_device_link);