mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
Change int to size_t in size var for tap/vhost FDs
A number of methods take an int for a parameter that indicates the size of an array. The correct type for array sizes is size_t
This commit is contained in:
parent
d654bc4190
commit
c5b6a4a5cb
@ -289,7 +289,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
int *tapfd,
|
||||
int *tapfdSize)
|
||||
size_t *tapfdSize)
|
||||
{
|
||||
const char *brname;
|
||||
int ret = -1;
|
||||
@ -433,7 +433,7 @@ qemuOpenVhostNet(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
int *vhostfd,
|
||||
int *vhostfdSize)
|
||||
size_t *vhostfdSize)
|
||||
{
|
||||
size_t i;
|
||||
const char *vhostnet_path = net->backend.vhost;
|
||||
@ -490,7 +490,7 @@ qemuOpenVhostNet(virDomainDefPtr def,
|
||||
"but is unavailable"));
|
||||
goto error;
|
||||
}
|
||||
VIR_WARN("Unable to open vhost-net. Opened so far %zu, requested %d",
|
||||
VIR_WARN("Unable to open vhost-net. Opened so far %zu, requested %zu",
|
||||
i, *vhostfdSize);
|
||||
*vhostfdSize = i;
|
||||
break;
|
||||
@ -4353,7 +4353,7 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
int vlan,
|
||||
int bootindex,
|
||||
int vhostfdSize,
|
||||
size_t vhostfdSize,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
@ -4455,7 +4455,7 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
if (usingVirtio && vhostfdSize > 1) {
|
||||
/* As advised at http://www.linux-kvm.org/page/Multiqueue
|
||||
* we should add vectors=2*N+2 where N is the vhostfdSize */
|
||||
virBufferAsprintf(&buf, ",mq=on,vectors=%d", 2 * vhostfdSize + 2);
|
||||
virBufferAsprintf(&buf, ",mq=on,vectors=%zu", 2 * vhostfdSize + 2);
|
||||
}
|
||||
if (vlan == -1)
|
||||
virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias);
|
||||
@ -4488,9 +4488,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
|
||||
char type_sep,
|
||||
int vlan,
|
||||
char **tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
char **vhostfd,
|
||||
int vhostfdSize)
|
||||
size_t vhostfdSize)
|
||||
{
|
||||
bool is_tap = false;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
@ -7359,9 +7359,9 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
|
||||
int ret = -1;
|
||||
char *nic = NULL, *host = NULL;
|
||||
int *tapfd = NULL;
|
||||
int tapfdSize = 0;
|
||||
size_t tapfdSize = 0;
|
||||
int *vhostfd = NULL;
|
||||
int vhostfdSize = 0;
|
||||
size_t vhostfdSize = 0;
|
||||
char **tapfdName = NULL;
|
||||
char **vhostfdName = NULL;
|
||||
int actualType = virDomainNetGetActualType(net);
|
||||
|
@ -98,9 +98,9 @@ char *qemuBuildHostNetStr(virDomainNetDefPtr net,
|
||||
char type_sep,
|
||||
int vlan,
|
||||
char **tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
char **vhostfd,
|
||||
int vhostfdSize);
|
||||
size_t vhostfdSize);
|
||||
|
||||
/* Legacy, pre device support */
|
||||
char *qemuBuildNicStr(virDomainNetDefPtr net,
|
||||
@ -112,7 +112,7 @@ char *qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
int vlan,
|
||||
int bootindex,
|
||||
int vhostfdSize,
|
||||
size_t vhostfdSize,
|
||||
virQEMUCapsPtr qemuCaps);
|
||||
|
||||
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
|
||||
@ -195,7 +195,7 @@ int qemuNetworkIfaceConnect(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
int *tapfd,
|
||||
int *tapfdSize)
|
||||
size_t *tapfdSize)
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuPhysIfaceConnect(virDomainDefPtr def,
|
||||
@ -208,7 +208,7 @@ int qemuOpenVhostNet(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
int *vhostfd,
|
||||
int *vhostfdSize);
|
||||
size_t *vhostfdSize);
|
||||
|
||||
int qemuNetworkPrepareDevices(virDomainDefPtr def);
|
||||
|
||||
|
@ -825,10 +825,10 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
char **tapfdName = NULL;
|
||||
int *tapfd = NULL;
|
||||
int tapfdSize = 0;
|
||||
size_t tapfdSize = 0;
|
||||
char **vhostfdName = NULL;
|
||||
int *vhostfd = NULL;
|
||||
int vhostfdSize = 0;
|
||||
size_t vhostfdSize = 0;
|
||||
char *nicstr = NULL;
|
||||
char *netstr = NULL;
|
||||
virNetDevVPortProfilePtr vport = NULL;
|
||||
|
@ -235,7 +235,7 @@ virNetDevProbeVnetHdr(int tapfd)
|
||||
int virNetDevTapCreate(char **ifname,
|
||||
const char *tunpath,
|
||||
int *tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
unsigned int flags)
|
||||
{
|
||||
size_t i;
|
||||
@ -370,7 +370,7 @@ int virNetDevTapDelete(const char *ifname,
|
||||
int virNetDevTapCreate(char **ifname,
|
||||
const char *tunpath ATTRIBUTE_UNUSED,
|
||||
int *tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
unsigned int flags ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int s;
|
||||
@ -481,7 +481,7 @@ int virNetDevTapDelete(const char *ifname,
|
||||
int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
|
||||
const char *tunpath ATTRIBUTE_UNUSED,
|
||||
int *tapfd ATTRIBUTE_UNUSED,
|
||||
int tapfdSize ATTRIBUTE_UNUSED,
|
||||
size_t tapfdSize ATTRIBUTE_UNUSED,
|
||||
unsigned int flags ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virReportSystemError(ENOSYS, "%s",
|
||||
@ -534,7 +534,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
||||
const unsigned char *vmuuid,
|
||||
const char *tunpath,
|
||||
int *tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
virNetDevVlanPtr virtVlan,
|
||||
unsigned int flags)
|
||||
|
@ -36,7 +36,7 @@
|
||||
int virNetDevTapCreate(char **ifname,
|
||||
const char *tunpath,
|
||||
int *tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
unsigned int flags)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
@ -68,7 +68,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
|
||||
const unsigned char *vmuuid,
|
||||
const char *tunpath,
|
||||
int *tapfd,
|
||||
int tapfdSize,
|
||||
size_t tapfdSize,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
virNetDevVlanPtr virtVlan,
|
||||
unsigned int flags)
|
||||
|
Loading…
Reference in New Issue
Block a user