virJSONValue *
qemuBuildNicDevProps(virDomainDef *def,
virDomainNetDef *net,
- size_t vhostfdSize,
virQEMUCaps *qemuCaps)
{
g_autoptr(virJSONValue) props = NULL;
}
}
- if (vhostfdSize > 1) {
+ if (net->driver.virtio.queues > 1) {
if (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
/* ccw provides a one to one relation of fds to queues and
* does not support the vectors option
* we should add vectors=2*N+2 where N is the vhostfdSize
*/
mq = VIR_TRISTATE_SWITCH_ON;
- vectors = 2 * vhostfdSize + 2;
+ vectors = 2 * net->driver.virtio.queues + 2;
}
}
if (qemuCommandAddExtDevice(cmd, &net->info, def, qemuCaps) < 0)
goto cleanup;
- if (!(nicprops = qemuBuildNicDevProps(def, net, net->driver.virtio.queues, qemuCaps)))
+ if (!(nicprops = qemuBuildNicDevProps(def, net, qemuCaps)))
goto cleanup;
if (qemuBuildDeviceCommandlineFromJSON(cmd, nicprops, def, qemuCaps) < 0)
goto cleanup;
char **vhostfdName = NULL;
int *vhostfd = NULL;
size_t vhostfdSize = 0;
- size_t queueSize = 0;
g_autoptr(virJSONValue) nicprops = NULL;
g_autoptr(virJSONValue) netprops = NULL;
int ret = -1;
tapfdSize = vhostfdSize = net->driver.virtio.queues;
if (!tapfdSize)
tapfdSize = vhostfdSize = 1;
- queueSize = tapfdSize;
tapfd = g_new0(int, tapfdSize);
memset(tapfd, -1, sizeof(*tapfd) * tapfdSize);
vhostfd = g_new0(int, vhostfdSize);
tapfdSize = vhostfdSize = net->driver.virtio.queues;
if (!tapfdSize)
tapfdSize = vhostfdSize = 1;
- queueSize = tapfdSize;
tapfd = g_new0(int, tapfdSize);
memset(tapfd, -1, sizeof(*tapfd) * tapfdSize);
vhostfd = g_new0(int, vhostfdSize);
tapfdSize = vhostfdSize = net->driver.virtio.queues;
if (!tapfdSize)
tapfdSize = vhostfdSize = 1;
- queueSize = tapfdSize;
tapfd = g_new0(int, tapfdSize);
memset(tapfd, -1, sizeof(*tapfd) * tapfdSize);
vhostfd = g_new0(int, vhostfdSize);
break;
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
- queueSize = net->driver.virtio.queues;
- if (!queueSize)
- queueSize = 1;
if (!qemuDomainSupportsNicdev(vm->def, net)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Nicdev support unavailable"));
break;
case VIR_DOMAIN_NET_TYPE_VDPA:
- queueSize = net->driver.virtio.queues;
- if (!queueSize)
- queueSize = 1;
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
goto cleanup;
adjustmemlock = true;
for (i = 0; i < vhostfdSize; i++)
VIR_FORCE_CLOSE(vhostfd[i]);
- if (!(nicprops = qemuBuildNicDevProps(vm->def, net, queueSize, priv->qemuCaps)))
+ if (!(nicprops = qemuBuildNicDevProps(vm->def, net, priv->qemuCaps)))
goto try_remove;
qemuDomainObjEnterMonitor(driver, vm);