|
|
43fe83 |
From 3a1d215c947592bdf9db3cb65480add04119bb98 Mon Sep 17 00:00:00 2001
|
|
|
43fe83 |
Message-Id: <3a1d215c947592bdf9db3cb65480add04119bb98.1383922565.git.jdenemar@redhat.com>
|
|
|
43fe83 |
From: Laine Stump <laine@laine.org>
|
|
|
43fe83 |
Date: Fri, 8 Nov 2013 05:42:32 -0700
|
|
|
43fe83 |
Subject: [PATCH] util: use size_t instead of unsigned int for
|
|
|
43fe83 |
num_virtual_functions
|
|
|
43fe83 |
|
|
|
43fe83 |
This is a prerequisite to the fix for the fix to:
|
|
|
43fe83 |
|
|
|
43fe83 |
https://bugzilla.redhat.com/show_bug.cgi?id=1025397
|
|
|
43fe83 |
|
|
|
43fe83 |
num_virtual_functions needs to be size_t in order to use the
|
|
|
43fe83 |
VIR_APPEND_ELEMENT macro.
|
|
|
43fe83 |
|
|
|
43fe83 |
(cherry picked from commit 89e2a6c88c2d26cf3a9a70adc8fdac970a471b64)
|
|
|
43fe83 |
|
|
|
43fe83 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
43fe83 |
---
|
|
|
43fe83 |
src/conf/node_device_conf.h | 2 +-
|
|
|
43fe83 |
src/network/bridge_driver.c | 2 +-
|
|
|
43fe83 |
src/util/virnetdev.c | 4 ++--
|
|
|
43fe83 |
src/util/virnetdev.h | 2 +-
|
|
|
43fe83 |
src/util/virpci.c | 8 ++++----
|
|
|
43fe83 |
src/util/virpci.h | 2 +-
|
|
|
43fe83 |
6 files changed, 10 insertions(+), 10 deletions(-)
|
|
|
43fe83 |
|
|
|
43fe83 |
diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
|
|
|
43fe83 |
index 1fa61b5..60cf8c3 100644
|
|
|
43fe83 |
--- a/src/conf/node_device_conf.h
|
|
|
43fe83 |
+++ b/src/conf/node_device_conf.h
|
|
|
43fe83 |
@@ -110,7 +110,7 @@ struct _virNodeDevCapsDef {
|
|
|
43fe83 |
char *vendor_name;
|
|
|
43fe83 |
virPCIDeviceAddressPtr physical_function;
|
|
|
43fe83 |
virPCIDeviceAddressPtr *virtual_functions;
|
|
|
43fe83 |
- unsigned int num_virtual_functions;
|
|
|
43fe83 |
+ size_t num_virtual_functions;
|
|
|
43fe83 |
unsigned int flags;
|
|
|
43fe83 |
virPCIDeviceAddressPtr *iommuGroupDevices;
|
|
|
43fe83 |
size_t nIommuGroupDevices;
|
|
|
43fe83 |
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
|
|
|
43fe83 |
index c900478..6e31840 100644
|
|
|
43fe83 |
--- a/src/network/bridge_driver.c
|
|
|
43fe83 |
+++ b/src/network/bridge_driver.c
|
|
|
43fe83 |
@@ -3736,7 +3736,7 @@ int networkRegister(void) {
|
|
|
43fe83 |
*/
|
|
|
43fe83 |
static int
|
|
|
43fe83 |
networkCreateInterfacePool(virNetworkDefPtr netdef) {
|
|
|
43fe83 |
- unsigned int num_virt_fns = 0;
|
|
|
43fe83 |
+ size_t num_virt_fns = 0;
|
|
|
43fe83 |
char **vfname = NULL;
|
|
|
43fe83 |
virPCIDeviceAddressPtr *virt_fns;
|
|
|
43fe83 |
int ret = -1;
|
|
|
43fe83 |
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
|
|
|
43fe83 |
index 30df7a6..566a207 100644
|
|
|
43fe83 |
--- a/src/util/virnetdev.c
|
|
|
43fe83 |
+++ b/src/util/virnetdev.c
|
|
|
43fe83 |
@@ -1080,7 +1080,7 @@ int
|
|
|
43fe83 |
virNetDevGetVirtualFunctions(const char *pfname,
|
|
|
43fe83 |
char ***vfname,
|
|
|
43fe83 |
virPCIDeviceAddressPtr **virt_fns,
|
|
|
43fe83 |
- unsigned int *n_vfname)
|
|
|
43fe83 |
+ size_t *n_vfname)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
int ret = -1;
|
|
|
43fe83 |
size_t i;
|
|
|
43fe83 |
@@ -1267,7 +1267,7 @@ int
|
|
|
43fe83 |
virNetDevGetVirtualFunctions(const char *pfname ATTRIBUTE_UNUSED,
|
|
|
43fe83 |
char ***vfname ATTRIBUTE_UNUSED,
|
|
|
43fe83 |
virPCIDeviceAddressPtr **virt_fns ATTRIBUTE_UNUSED,
|
|
|
43fe83 |
- unsigned int *n_vfname ATTRIBUTE_UNUSED)
|
|
|
43fe83 |
+ size_t *n_vfname ATTRIBUTE_UNUSED)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
virReportSystemError(ENOSYS, "%s",
|
|
|
43fe83 |
_("Unable to get virtual functions on this platform"));
|
|
|
43fe83 |
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
|
|
|
43fe83 |
index 44a37ca..9fd6628 100644
|
|
|
43fe83 |
--- a/src/util/virnetdev.h
|
|
|
43fe83 |
+++ b/src/util/virnetdev.h
|
|
|
43fe83 |
@@ -124,7 +124,7 @@ int virNetDevGetPhysicalFunction(const char *ifname, char **pfname)
|
|
|
43fe83 |
int virNetDevGetVirtualFunctions(const char *pfname,
|
|
|
43fe83 |
char ***vfname,
|
|
|
43fe83 |
virPCIDeviceAddressPtr **virt_fns,
|
|
|
43fe83 |
- unsigned int *n_vfname)
|
|
|
43fe83 |
+ size_t *n_vfname)
|
|
|
43fe83 |
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
|
|
43fe83 |
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
|
|
|
43fe83 |
|
|
|
43fe83 |
diff --git a/src/util/virpci.c b/src/util/virpci.c
|
|
|
43fe83 |
index be95d03..87ea81b 100644
|
|
|
43fe83 |
--- a/src/util/virpci.c
|
|
|
43fe83 |
+++ b/src/util/virpci.c
|
|
|
43fe83 |
@@ -2385,7 +2385,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path,
|
|
|
43fe83 |
int
|
|
|
43fe83 |
virPCIGetVirtualFunctions(const char *sysfs_path,
|
|
|
43fe83 |
virPCIDeviceAddressPtr **virtual_functions,
|
|
|
43fe83 |
- unsigned int *num_virtual_functions)
|
|
|
43fe83 |
+ size_t *num_virtual_functions)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
int ret = -1;
|
|
|
43fe83 |
size_t i;
|
|
|
43fe83 |
@@ -2418,7 +2418,7 @@ virPCIGetVirtualFunctions(const char *sysfs_path,
|
|
|
43fe83 |
goto error;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
- VIR_DEBUG("Number of virtual functions: %d",
|
|
|
43fe83 |
+ VIR_DEBUG("Number of virtual functions: %zu",
|
|
|
43fe83 |
*num_virtual_functions);
|
|
|
43fe83 |
|
|
|
43fe83 |
if (virPCIGetDeviceAddressFromSysfsLink(device_link,
|
|
|
43fe83 |
@@ -2489,7 +2489,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
|
|
|
43fe83 |
{
|
|
|
43fe83 |
int ret = -1;
|
|
|
43fe83 |
size_t i;
|
|
|
43fe83 |
- unsigned int num_virt_fns = 0;
|
|
|
43fe83 |
+ size_t num_virt_fns = 0;
|
|
|
43fe83 |
virPCIDeviceAddressPtr vf_bdf = NULL;
|
|
|
43fe83 |
virPCIDeviceAddressPtr *virt_fns = NULL;
|
|
|
43fe83 |
|
|
|
43fe83 |
@@ -2634,7 +2634,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED,
|
|
|
43fe83 |
int
|
|
|
43fe83 |
virPCIGetVirtualFunctions(const char *sysfs_path ATTRIBUTE_UNUSED,
|
|
|
43fe83 |
virPCIDeviceAddressPtr **virtual_functions ATTRIBUTE_UNUSED,
|
|
|
43fe83 |
- unsigned int *num_virtual_functions ATTRIBUTE_UNUSED)
|
|
|
43fe83 |
+ size_t *num_virtual_functions ATTRIBUTE_UNUSED)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
|
|
|
43fe83 |
return -1;
|
|
|
43fe83 |
diff --git a/src/util/virpci.h b/src/util/virpci.h
|
|
|
43fe83 |
index 0aa6fee..0479f0b 100644
|
|
|
43fe83 |
--- a/src/util/virpci.h
|
|
|
43fe83 |
+++ b/src/util/virpci.h
|
|
|
43fe83 |
@@ -138,7 +138,7 @@ int virPCIGetPhysicalFunction(const char *sysfs_path,
|
|
|
43fe83 |
|
|
|
43fe83 |
int virPCIGetVirtualFunctions(const char *sysfs_path,
|
|
|
43fe83 |
virPCIDeviceAddressPtr **virtual_functions,
|
|
|
43fe83 |
- unsigned int *num_virtual_functions);
|
|
|
43fe83 |
+ size_t *num_virtual_functions);
|
|
|
43fe83 |
|
|
|
43fe83 |
int virPCIIsVirtualFunction(const char *vf_sysfs_device_link);
|
|
|
43fe83 |
|
|
|
43fe83 |
--
|
|
|
43fe83 |
1.8.4.2
|
|
|
43fe83 |
|