c401cc
From 0c94ea5029040ce3ab83c498db9b4ffb69d0e18a Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <0c94ea5029040ce3ab83c498db9b4ffb69d0e18a@dist-git>
c401cc
From: Michal Privoznik <mprivozn@redhat.com>
c401cc
Date: Tue, 4 Mar 2014 11:11:24 +0100
c401cc
Subject: [PATCH] qemuBuildNicDevStr: Adapt to new advisory on multiqueue
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1071888
c401cc
c401cc
As I did previously in 4f588a1b46, libvirt needs to set virtio vectors.
c401cc
Previously, we were advised to use vectors=N, where
c401cc
c401cc
N = 2 * (number of queues) + 1
c401cc
c401cc
However, just recently this advisory has changed on the Multiquue wiki
c401cc
page [1] to:
c401cc
c401cc
N = 2 * (number of queues) + 2
c401cc
c401cc
1: http://www.linux-kvm.org/page/Multiqueue#Enable_MQ_feature
c401cc
c401cc
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c401cc
(cherry picked from commit 042c4ab1c933ef45012b703b5cbd776422f491c8)
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/qemu/qemu_command.c | 4 ++--
c401cc
 1 file changed, 2 insertions(+), 2 deletions(-)
c401cc
c401cc
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
c401cc
index 54c36e3..4d4474c 100644
c401cc
--- a/src/qemu/qemu_command.c
c401cc
+++ b/src/qemu/qemu_command.c
c401cc
@@ -4904,8 +4904,8 @@ qemuBuildNicDevStr(virDomainDefPtr def,
c401cc
     }
c401cc
     if (usingVirtio && vhostfdSize > 1) {
c401cc
         /* As advised at http://www.linux-kvm.org/page/Multiqueue
c401cc
-         * we should add vectors=2*N+1 where N is the vhostfdSize */
c401cc
-        virBufferAsprintf(&buf, ",mq=on,vectors=%d", 2 * vhostfdSize + 1);
c401cc
+         * we should add vectors=2*N+2 where N is the vhostfdSize */
c401cc
+        virBufferAsprintf(&buf, ",mq=on,vectors=%d", 2 * vhostfdSize + 2);
c401cc
     }
c401cc
     if (vlan == -1)
c401cc
         virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias);
c401cc
-- 
c401cc
1.9.0
c401cc