virDomainNetDefPtr net,
int vlan,
int bootindex,
- bool multiqueue,
+ int vhostfdSize,
virQEMUCapsPtr qemuCaps)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
virDomainVirtioEventIdxTypeToString(net->driver.virtio.event_idx));
}
}
- if (usingVirtio && multiqueue)
- virBufferAddLit(&buf, ",mq=on");
+ if (usingVirtio && vhostfdSize > 1) {
+ /* As advised at http://www.linux-kvm.org/page/Multiqueue
+ * we should add vectors=2*N+1 where N is the vhostfdSize */
+ virBufferAsprintf(&buf, ",mq=on,vectors=%d", 2 * vhostfdSize + 1);
+ }
if (vlan == -1)
virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias);
else
virCommandAddArgList(cmd, "-netdev", host, NULL);
}
if (qemuDomainSupportsNicdev(def, qemuCaps, net)) {
- bool multiqueue = tapfdSize > 1 || vhostfdSize > 1;
-
if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex,
- multiqueue, qemuCaps)))
+ vhostfdSize, qemuCaps)))
goto cleanup;
virCommandAddArgList(cmd, "-device", nic, NULL);
} else {
}
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
- bool multiqueue = tapfdSize > 1 || vhostfdSize > 1;
-
if (!(nicstr = qemuBuildNicDevStr(vm->def, net, vlan, 0,
- multiqueue, priv->qemuCaps)))
+ vhostfdSize, priv->qemuCaps)))
goto try_remove;
} else {
if (!(nicstr = qemuBuildNicStr(net, NULL, vlan)))