[libvirt] [PATCH 0/4] Add support for vhost-user with multi-queue

Also some tiny clean-up. Martin Kletzander (2): conf: Ignore multiqueue with one queue. qemu: Add capability for vhost-user multiqueue Maxime Leroy (2): docs: Clarify that attribute name is not used for vhostuser qemu: add multiqueue vhost-user support docs/formatdomain.html.in | 16 ++++++++++++++-- src/conf/domain_conf.c | 3 ++- src/qemu/qemu_capabilities.c | 6 ++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 15 ++++++++++++++- ...tuser.args => qemuxml2argv-net-vhostuser-multiq.args} | 6 +++++- ...ostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} | 6 ++++++ .../qemuxml2argv-tap-vhost-incorrect.xml | 6 ++++++ tests/qemuxml2argvtest.c | 3 +++ .../qemuxml2xmlout-tap-vhost-incorrect.xml | 6 ++++++ 10 files changed, 63 insertions(+), 5 deletions(-) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.args => qemuxml2argv-net-vhostuser-multiq.args} (75%) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} (87%) -- 2.4.2

Multi != One. And indeed, libvirt behaves the same way for queues='1' as without such setting. Let's make it clear in the XML. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/conf/domain_conf.c | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-tap-vhost-incorrect.xml | 6 ++++++ tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 36de8441990e..2e7961001090 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8626,7 +8626,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, queues); goto error; } - def->driver.virtio.queues = q; + if (q > 1) + def->driver.virtio.queues = q; } if ((str = virXPathString("string(./driver/host/@csum)", ctxt))) { if ((val = virTristateSwitchTypeFromString(str)) <= 0) { diff --git a/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost-incorrect.xml b/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost-incorrect.xml index 2cf312f0ca53..28f93474136e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost-incorrect.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost-incorrect.xml @@ -28,6 +28,12 @@ <driver name='vhost' queues='5'/> <backend tap='/dev/null' vhost='/dev/zero'/> </interface> + <interface type='user'> + <mac address='52:54:00:e5:48:59'/> + <model type='virtio'/> + <driver name='vhost' queues='1'/> + <backend tap='/dev/null' vhost='/dev/zero'/> + </interface> <serial type='pty'> <target port='0'/> </serial> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml index 266cbf0a72b8..d419cc3b8e15 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml @@ -27,6 +27,12 @@ <model type='definitely-not-virtio'/> <backend tap='/dev/null'/> </interface> + <interface type='user'> + <mac address='52:54:00:e5:48:59'/> + <model type='virtio'/> + <driver name='vhost'/> + <backend tap='/dev/null' vhost='/dev/zero'/> + </interface> <serial type='pty'> <target port='0'/> </serial> -- 2.4.2

From: Maxime Leroy <maxime.leroy@6wind.com> Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 178199679ed3..72ad54cee188 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4190,6 +4190,11 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 1.0.5 (QEMU and KVM only, requires kernel 3.6 or newer)</span> </dd> + <dd> + For interfaces of type='vhostuser', the <code>name</code> + attribute is ignored. The backend driver used is always + vhost-user. + </dd> <dt><code>txmode</code></dt> <dd> -- 2.4.2

The support for this was added in QEMU with commit 830d70db692e374b55555f4407f96a1ceefdcc97. Unfortunately we have to do another ugly version-based capability check. The other option would be not to check for the capability at all and leave that to qemu as it's doen with multiqueue tap devices. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/qemu/qemu_capabilities.c | 6 ++++++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 960afa4ac0db..f102ed80f15e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -284,6 +284,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "aes-key-wrap", "dea-key-wrap", "pci-serial", + "vhost-user-multiq", ); @@ -3283,6 +3284,11 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 2002000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_VMPORT_OPT); + /* vhost-user supports multi-queue from v2.4.0 onwards, + * but there is no way to query for that capability */ + if (qemuCaps->version >= 2004000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOSTUSER_MULTIQ); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 9c956f3007be..3dbd767f2516 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -228,6 +228,7 @@ typedef enum { QEMU_CAPS_AES_KEY_WRAP = 186, /* -machine aes_key_wrap */ QEMU_CAPS_DEA_KEY_WRAP = 187, /* -machine dea_key_wrap */ QEMU_CAPS_DEVICE_PCI_SERIAL = 188, /* -device pci-serial */ + QEMU_CAPS_VHOSTUSER_MULTIQ = 189, /* vhost-user with -netdev queues= */ QEMU_CAPS_LAST, /* this must always be the last item */ } virQEMUCapsFlags; -- 2.4.2

On Thu, Jun 4, 2015 at 3:43 PM, Martin Kletzander <mkletzan@redhat.com> wrote:
The support for this was added in QEMU with commit 830d70db692e374b55555f4407f96a1ceefdcc97. Unfortunately we have to do another ugly version-based capability check. The other option would be not to check for the capability at all and leave that to qemu as it's doen with multiqueue tap devices.
typo: doen --> done

On Thu, Jun 04, 2015 at 05:56:20PM +0200, Maxime Leroy wrote:
On Thu, Jun 4, 2015 at 3:43 PM, Martin Kletzander <mkletzan@redhat.com> wrote:
The support for this was added in QEMU with commit 830d70db692e374b55555f4407f96a1ceefdcc97. Unfortunately we have to do another ugly version-based capability check. The other option would be not to check for the capability at all and leave that to qemu as it's doen with multiqueue tap devices.
typo: doen --> done
good catch :) I'll repost the series just so it's cleaner for other reviewers. Thanks for having a look at it.
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

From: Maxime Leroy <maxime.leroy@6wind.com> This patch adds the support of queues attribute of the driver element for vhost-user interface type. Example: <interface type='vhostuser'> <mac address='52:54:00:ee:96:6d'/> <source type='unix' path='/tmp/vhost2.sock' mode='client'/> <model type='virtio'/> <driver queues='4'/> </interface> Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 11 +++++++++-- src/qemu/qemu_command.c | 15 ++++++++++++++- ...stuser.args => qemuxml2argv-net-vhostuser-multiq.args} | 6 +++++- ...hostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} | 6 ++++++ tests/qemuxml2argvtest.c | 3 +++ 5 files changed, 37 insertions(+), 4 deletions(-) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.args => qemuxml2argv-net-vhostuser-multiq.args} (75%) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} (87%) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 72ad54cee188..85238a16af8d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4260,7 +4260,8 @@ qemu-kvm -net nic,model=? /dev/null type='virtio'/></code>, multiple packet processing queues can be created; each queue will potentially be handled by a different processor, resulting in much higher throughput. - <span class="since">Since 1.0.6 (QEMU and KVM only)</span> + <span class="since">Since 1.0.6 (QEMU and KVM only) and for vhost-user + since 1.2.17</span> </dd> <dt><code>host</code> offloading options</dt> <dd> @@ -4581,9 +4582,15 @@ qemu-kvm -net nic,model=? /dev/null <devices> <interface type='vhostuser'> <mac address='52:54:00:3b:83:1a'/> - <source type='unix' path='/tmp/vhost.sock' mode='server'/> + <source type='unix' path='/tmp/vhost1.sock' mode='server'/> <model type='virtio'/> </interface> + <interface type='vhostuser'> + <mac address='52:54:00:3b:83:1b'/> + <source type='unix' path='/tmp/vhost2.sock' mode='client'/> + <model type='virtio'/> + <driver queues='5'/> + </interface> </devices> ...</pre> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 61faa576e11b..f805f6700e71 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8089,6 +8089,7 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd, { virBuffer chardev_buf = VIR_BUFFER_INITIALIZER; virBuffer netdev_buf = VIR_BUFFER_INITIALIZER; + unsigned int queues = 1; char *nic = NULL; if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) { @@ -8126,13 +8127,25 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd, virBufferAsprintf(&netdev_buf, "type=vhost-user,id=host%s,chardev=char%s", net->info.alias, net->info.alias); + queues = net->driver.virtio.queues; + if (queues) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOSTUSER_MULTIQ)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("multi-queue is not supported for vhost-user " + "with this QEMU binary")); + goto error; + } + virBufferAsprintf(&netdev_buf, ",queues=%u", queues); + } + virCommandAddArg(cmd, "-chardev"); virCommandAddArgBuffer(cmd, &chardev_buf); virCommandAddArg(cmd, "-netdev"); virCommandAddArgBuffer(cmd, &netdev_buf); - if (!(nic = qemuBuildNicDevStr(def, net, -1, bootindex, 0, qemuCaps))) { + if (!(nic = qemuBuildNicDevStr(def, net, -1, bootindex, + queues, qemuCaps))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Error generating NIC -device string")); goto error; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args similarity index 75% copy from tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args copy to tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args index ac43630979ad..8affb53b3958 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args @@ -9,4 +9,8 @@ pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,n -netdev type=vhost-user,id=hostnet1,chardev=charnet1 \ -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,addr=0x4 \ -netdev socket,listen=:2015,id=hostnet2 \ --device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,addr=0x5 +-device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,addr=0x5 \ +-chardev socket,id=charnet3,path=/tmp/vhost2.sock \ +-netdev type=vhost-user,id=hostnet3,chardev=charnet3,queues=4 \ +-device virtio-net-pci,mq=on,vectors=10,netdev=hostnet3,id=net3,mac=52:54:00:ee:96:6d,\ +bus=pci.0,addr=0x6 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml similarity index 87% copy from tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml copy to tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml index fa09157cd570..422fa920513c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml @@ -38,6 +38,12 @@ <source port='2015'/> <model type='rtl8139'/> </interface> + <interface type='vhostuser'> + <mac address='52:54:00:ee:96:6d'/> + <source type='unix' path='/tmp/vhost2.sock' mode='client'/> + <model type='virtio'/> + <driver queues='4'/> + </interface> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 11e09ce10d43..26c05452511b 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -980,6 +980,9 @@ mymain(void) DO_TEST("misc-uuid", QEMU_CAPS_NAME, QEMU_CAPS_UUID); DO_TEST_PARSE_ERROR("vhost_queues-invalid", NONE); DO_TEST("net-vhostuser", QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV); + DO_TEST("net-vhostuser-multiq", + QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV, QEMU_CAPS_VHOSTUSER_MULTIQ); + DO_TEST_FAILURE("net-vhostuser-multiq", QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV); DO_TEST("net-user", NONE); DO_TEST("net-virtio", NONE); DO_TEST("net-virtio-device", -- 2.4.2

On Thu, Jun 04, 2015 at 03:43:54PM +0200, Martin Kletzander wrote:
From: Maxime Leroy <maxime.leroy@6wind.com>
This patch adds the support of queues attribute of the driver element for vhost-user interface type. Example:
<interface type='vhostuser'> <mac address='52:54:00:ee:96:6d'/> <source type='unix' path='/tmp/vhost2.sock' mode='client'/> <model type='virtio'/> <driver queues='4'/> </interface>
I forgot to mention that this patch is for the following BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1207692

On Thu, Jun 4, 2015 at 3:43 PM, Martin Kletzander <mkletzan@redhat.com> wrote:
From: Maxime Leroy <maxime.leroy@6wind.com>
This patch adds the support of queues attribute of the driver element for vhost-user interface type. Example:
<interface type='vhostuser'> <mac address='52:54:00:ee:96:6d'/> <source type='unix' path='/tmp/vhost2.sock' mode='client'/> <model type='virtio'/> <driver queues='4'/> </interface>
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 11 +++++++++-- src/qemu/qemu_command.c | 15 ++++++++++++++- ...stuser.args => qemuxml2argv-net-vhostuser-multiq.args} | 6 +++++- ...hostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} | 6 ++++++ tests/qemuxml2argvtest.c | 3 +++ 5 files changed, 37 insertions(+), 4 deletions(-) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.args => qemuxml2argv-net-vhostuser-multiq.args} (75%) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} (87%)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 72ad54cee188..85238a16af8d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4260,7 +4260,8 @@ qemu-kvm -net nic,model=? /dev/null type='virtio'/></code>, multiple packet processing queues can be created; each queue will potentially be handled by a different processor, resulting in much higher throughput. - <span class="since">Since 1.0.6 (QEMU and KVM only)</span> + <span class="since">Since 1.0.6 (QEMU and KVM only) and for vhost-user + since 1.2.17</span> </dd> <dt><code>host</code> offloading options</dt> <dd> @@ -4581,9 +4582,15 @@ qemu-kvm -net nic,model=? /dev/null <devices> <interface type='vhostuser'> <mac address='52:54:00:3b:83:1a'/> - <source type='unix' path='/tmp/vhost.sock' mode='server'/> + <source type='unix' path='/tmp/vhost1.sock' mode='server'/> <model type='virtio'/> </interface> + <interface type='vhostuser'> + <mac address='52:54:00:3b:83:1b'/> + <source type='unix' path='/tmp/vhost2.sock' mode='client'/> + <model type='virtio'/> + <driver queues='5'/> + </interface> </devices> ...</pre>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 61faa576e11b..f805f6700e71 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8089,6 +8089,7 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd, { virBuffer chardev_buf = VIR_BUFFER_INITIALIZER; virBuffer netdev_buf = VIR_BUFFER_INITIALIZER; + unsigned int queues = 1;
Why setting queues to 1 and not to net->driver.virtio.queues directly ?
char *nic = NULL;
if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) { @@ -8126,13 +8127,25 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd, virBufferAsprintf(&netdev_buf, "type=vhost-user,id=host%s,chardev=char%s", net->info.alias, net->info.alias);
+ queues = net->driver.virtio.queues; + if (queues) {
I know it's never set to 1 thanks to your patch: "conf: Ignore multiqueue with one queue." Anyway I think we should check if queues is superior to 1 for improving code readability.

On Thu, Jun 04, 2015 at 05:54:17PM +0200, Maxime Leroy wrote:
On Thu, Jun 4, 2015 at 3:43 PM, Martin Kletzander <mkletzan@redhat.com> wrote:
From: Maxime Leroy <maxime.leroy@6wind.com>
This patch adds the support of queues attribute of the driver element for vhost-user interface type. Example:
<interface type='vhostuser'> <mac address='52:54:00:ee:96:6d'/> <source type='unix' path='/tmp/vhost2.sock' mode='client'/> <model type='virtio'/> <driver queues='4'/> </interface>
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/formatdomain.html.in | 11 +++++++++-- src/qemu/qemu_command.c | 15 ++++++++++++++- ...stuser.args => qemuxml2argv-net-vhostuser-multiq.args} | 6 +++++- ...hostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} | 6 ++++++ tests/qemuxml2argvtest.c | 3 +++ 5 files changed, 37 insertions(+), 4 deletions(-) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.args => qemuxml2argv-net-vhostuser-multiq.args} (75%) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} (87%)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 72ad54cee188..85238a16af8d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4260,7 +4260,8 @@ qemu-kvm -net nic,model=? /dev/null type='virtio'/></code>, multiple packet processing queues can be created; each queue will potentially be handled by a different processor, resulting in much higher throughput. - <span class="since">Since 1.0.6 (QEMU and KVM only)</span> + <span class="since">Since 1.0.6 (QEMU and KVM only) and for vhost-user + since 1.2.17</span> </dd> <dt><code>host</code> offloading options</dt> <dd> @@ -4581,9 +4582,15 @@ qemu-kvm -net nic,model=? /dev/null <devices> <interface type='vhostuser'> <mac address='52:54:00:3b:83:1a'/> - <source type='unix' path='/tmp/vhost.sock' mode='server'/> + <source type='unix' path='/tmp/vhost1.sock' mode='server'/> <model type='virtio'/> </interface> + <interface type='vhostuser'> + <mac address='52:54:00:3b:83:1b'/> + <source type='unix' path='/tmp/vhost2.sock' mode='client'/> + <model type='virtio'/> + <driver queues='5'/> + </interface> </devices> ...</pre>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 61faa576e11b..f805f6700e71 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8089,6 +8089,7 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd, { virBuffer chardev_buf = VIR_BUFFER_INITIALIZER; virBuffer netdev_buf = VIR_BUFFER_INITIALIZER; + unsigned int queues = 1;
Why setting queues to 1 and not to net->driver.virtio.queues directly ?
Oh, you're right, I didn't write it from scratch, I just renamed it. I'm amending the patch right now.
char *nic = NULL;
if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) { @@ -8126,13 +8127,25 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd, virBufferAsprintf(&netdev_buf, "type=vhost-user,id=host%s,chardev=char%s", net->info.alias, net->info.alias);
+ queues = net->driver.virtio.queues; + if (queues) {
I know it's never set to 1 thanks to your patch: "conf: Ignore multiqueue with one queue."
Anyway I think we should check if queues is superior to 1 for improving code readability.
It seems more readable to me if you just check whether there is anything to setup (treating it as a bool) and then just setting up what needs to be done. I'm OK with changing it back to (queues > 1).
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Hi Martin, On Thu, Jun 4, 2015 at 3:43 PM, Martin Kletzander <mkletzan@redhat.com> wrote:
Also some tiny clean-up.
Martin Kletzander (2): conf: Ignore multiqueue with one queue. qemu: Add capability for vhost-user multiqueue
Maxime Leroy (2): docs: Clarify that attribute name is not used for vhostuser qemu: add multiqueue vhost-user support
docs/formatdomain.html.in | 16 ++++++++++++++-- src/conf/domain_conf.c | 3 ++- src/qemu/qemu_capabilities.c | 6 ++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 15 ++++++++++++++- ...tuser.args => qemuxml2argv-net-vhostuser-multiq.args} | 6 +++++- ...ostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} | 6 ++++++ .../qemuxml2argv-tap-vhost-incorrect.xml | 6 ++++++ tests/qemuxml2argvtest.c | 3 +++ .../qemuxml2xmlout-tap-vhost-incorrect.xml | 6 ++++++ 10 files changed, 63 insertions(+), 5 deletions(-) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.args => qemuxml2argv-net-vhostuser-multiq.args} (75%) copy tests/qemuxml2argvdata/{qemuxml2argv-net-vhostuser.xml => qemuxml2argv-net-vhostuser-multiq.xml} (87%)
-- 2.4.2
Thanks to send theses patches on the mailing list. Except few comments, it looks good for me.
participants (2)
-
Martin Kletzander
-
Maxime Leroy