提交 89e2a6c8 编写于 作者: L Laine Stump

util: use size_t instead of unsigned int for num_virtual_functions

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.
上级 54e4d9d0
...@@ -110,7 +110,7 @@ struct _virNodeDevCapsDef { ...@@ -110,7 +110,7 @@ struct _virNodeDevCapsDef {
char *vendor_name; char *vendor_name;
virPCIDeviceAddressPtr physical_function; virPCIDeviceAddressPtr physical_function;
virPCIDeviceAddressPtr *virtual_functions; virPCIDeviceAddressPtr *virtual_functions;
unsigned int num_virtual_functions; size_t num_virtual_functions;
unsigned int flags; unsigned int flags;
virPCIDeviceAddressPtr *iommuGroupDevices; virPCIDeviceAddressPtr *iommuGroupDevices;
size_t nIommuGroupDevices; size_t nIommuGroupDevices;
......
...@@ -3046,7 +3046,7 @@ int networkRegister(void) { ...@@ -3046,7 +3046,7 @@ int networkRegister(void) {
*/ */
static int static int
networkCreateInterfacePool(virNetworkDefPtr netdef) { networkCreateInterfacePool(virNetworkDefPtr netdef) {
unsigned int num_virt_fns = 0; size_t num_virt_fns = 0;
char **vfname = NULL; char **vfname = NULL;
virPCIDeviceAddressPtr *virt_fns; virPCIDeviceAddressPtr *virt_fns;
int ret = -1; int ret = -1;
......
...@@ -1104,7 +1104,7 @@ int ...@@ -1104,7 +1104,7 @@ int
virNetDevGetVirtualFunctions(const char *pfname, virNetDevGetVirtualFunctions(const char *pfname,
char ***vfname, char ***vfname,
virPCIDeviceAddressPtr **virt_fns, virPCIDeviceAddressPtr **virt_fns,
unsigned int *n_vfname) size_t *n_vfname)
{ {
int ret = -1; int ret = -1;
size_t i; size_t i;
...@@ -1291,7 +1291,7 @@ int ...@@ -1291,7 +1291,7 @@ int
virNetDevGetVirtualFunctions(const char *pfname ATTRIBUTE_UNUSED, virNetDevGetVirtualFunctions(const char *pfname ATTRIBUTE_UNUSED,
char ***vfname ATTRIBUTE_UNUSED, char ***vfname ATTRIBUTE_UNUSED,
virPCIDeviceAddressPtr **virt_fns ATTRIBUTE_UNUSED, virPCIDeviceAddressPtr **virt_fns ATTRIBUTE_UNUSED,
unsigned int *n_vfname ATTRIBUTE_UNUSED) size_t *n_vfname ATTRIBUTE_UNUSED)
{ {
virReportSystemError(ENOSYS, "%s", virReportSystemError(ENOSYS, "%s",
_("Unable to get virtual functions on this platform")); _("Unable to get virtual functions on this platform"));
......
...@@ -124,7 +124,7 @@ int virNetDevGetPhysicalFunction(const char *ifname, char **pfname) ...@@ -124,7 +124,7 @@ int virNetDevGetPhysicalFunction(const char *ifname, char **pfname)
int virNetDevGetVirtualFunctions(const char *pfname, int virNetDevGetVirtualFunctions(const char *pfname,
char ***vfname, char ***vfname,
virPCIDeviceAddressPtr **virt_fns, virPCIDeviceAddressPtr **virt_fns,
unsigned int *n_vfname) size_t *n_vfname)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
......
...@@ -2385,7 +2385,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path, ...@@ -2385,7 +2385,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path,
int int
virPCIGetVirtualFunctions(const char *sysfs_path, virPCIGetVirtualFunctions(const char *sysfs_path,
virPCIDeviceAddressPtr **virtual_functions, virPCIDeviceAddressPtr **virtual_functions,
unsigned int *num_virtual_functions) size_t *num_virtual_functions)
{ {
int ret = -1; int ret = -1;
size_t i; size_t i;
...@@ -2418,7 +2418,7 @@ virPCIGetVirtualFunctions(const char *sysfs_path, ...@@ -2418,7 +2418,7 @@ virPCIGetVirtualFunctions(const char *sysfs_path,
goto error; goto error;
} }
VIR_DEBUG("Number of virtual functions: %d", VIR_DEBUG("Number of virtual functions: %zu",
*num_virtual_functions); *num_virtual_functions);
if (virPCIGetDeviceAddressFromSysfsLink(device_link, if (virPCIGetDeviceAddressFromSysfsLink(device_link,
...@@ -2489,7 +2489,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link, ...@@ -2489,7 +2489,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
{ {
int ret = -1; int ret = -1;
size_t i; size_t i;
unsigned int num_virt_fns = 0; size_t num_virt_fns = 0;
virPCIDeviceAddressPtr vf_bdf = NULL; virPCIDeviceAddressPtr vf_bdf = NULL;
virPCIDeviceAddressPtr *virt_fns = NULL; virPCIDeviceAddressPtr *virt_fns = NULL;
...@@ -2634,7 +2634,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED, ...@@ -2634,7 +2634,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED,
int int
virPCIGetVirtualFunctions(const char *sysfs_path ATTRIBUTE_UNUSED, virPCIGetVirtualFunctions(const char *sysfs_path ATTRIBUTE_UNUSED,
virPCIDeviceAddressPtr **virtual_functions 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)); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
return -1; return -1;
......
...@@ -138,7 +138,7 @@ int virPCIGetPhysicalFunction(const char *sysfs_path, ...@@ -138,7 +138,7 @@ int virPCIGetPhysicalFunction(const char *sysfs_path,
int virPCIGetVirtualFunctions(const char *sysfs_path, int virPCIGetVirtualFunctions(const char *sysfs_path,
virPCIDeviceAddressPtr **virtual_functions, virPCIDeviceAddressPtr **virtual_functions,
unsigned int *num_virtual_functions); size_t *num_virtual_functions);
int virPCIIsVirtualFunction(const char *vf_sysfs_device_link); int virPCIIsVirtualFunction(const char *vf_sysfs_device_link);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册