diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3cafbfb600..a2fcb649b3 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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); diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 6246a8552c..dcc7127324 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -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); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bf1f69a1ff..6f62345e4b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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; diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 85688ab1e3..83b4131951 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -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) diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index c0a4e15fc7..20dec58b7f 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -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)