[libvirt] [PATCHv4 3/4] qemu: Adapt qemuBuildInterfaceCommandLine to to multiqueue net

Michal Privoznik mprivozn at redhat.com
Wed May 22 15:46:45 UTC 2013


On 21.05.2013 18:37, Laine Stump wrote:
> On 05/21/2013 10:18 AM, Michal Privoznik wrote:
>> In order to learn libvirt multiqueue several things must be done:
>>
>> 1) The '/dev/net/tun' device needs to be opened multiple times with
>> IFF_MULTI_QUEUE flag passed to ioctl(fd, TUNSETIFF, &ifr);
>>
>> 2) Similar, the '/dev/vhost-net' must be opened as many times as in 1)
> 
> s/Similar, the/Similarly,/
> 
>> in order to keep 1:1 ratio recommended by qemu and kernel folks.
>>
>> 3) The command line construction code needs to switch from 'fd=X' to
>> 'fds=X:Y:...:Z' and from 'vhostfd=X' to 'vhostfds=X:Y:...:Z'.
>>
>> 4) The monitor handling code needs to learn to pass multiple FDs.
>> ---
>>  src/network/bridge_driver.c |   2 +-
>>  src/qemu/qemu_command.c     | 260 ++++++++++++++++++++++++++++++--------------
>>  src/qemu/qemu_command.h     |  13 ++-
>>  src/qemu/qemu_hotplug.c     |  98 ++++++++++++-----
>>  src/qemu/qemu_monitor.c     |  78 +++++++------
>>  src/qemu/qemu_monitor.h     |   8 +-
>>  src/uml/uml_conf.c          |   5 +-
>>  src/util/virnetdevtap.c     | 113 ++++++++++---------
>>  src/util/virnetdevtap.h     |   2 +
>>  9 files changed, 378 insertions(+), 201 deletions(-)

> ACK. (I'm undecided if we should error out if multi-queue is requested
> when running non-privileged, and I don't care enough about the extra
> braces to require you to add them (and it's not in the official coding
> style))
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

Okay, I squashed this in:

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6011882..6203eec 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -371,7 +371,10 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
             goto cleanup;
         }
         /* qemuCreateInBridgePortWithHelper can only create a single FD */
-        *tapfdSize = 1;
+        if (*tapfdSize > 1) {
+            VIR_WARN("Ignoring multiqueue network request");
+            *tapfdSize = 1;
+        }
     }

     virDomainAuditNetDevice(def, net, "/dev/net/tun", true);
@@ -394,9 +397,9 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
     }

     if (net->filter && net->ifname &&
-        virDomainConfNWFilterInstantiate(conn, def->uuid, net) < 0)
+        virDomainConfNWFilterInstantiate(conn, def->uuid, net) < 0) {
         goto cleanup;
-
+    }

     ret = 0;





More information about the libvir-list mailing list