RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1285697 - [RFE] Add "nowait" support for vhost-user
Summary: [RFE] Add "nowait" support for vhost-user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Victor Kaplansky
QA Contact: Sitong Liu
URL:
Whiteboard:
Depends On:
Blocks: 1288337
TreeView+ depends on / blocked
 
Reported: 2015-11-26 09:57 UTC by Amnon Ilan
Modified: 2018-12-04 09:07 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-04 09:07:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1240324 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1240324

Description Amnon Ilan 2015-11-26 09:57:48 UTC
Description of problem:

Vhost-user should support "nowait": when a guest is starting and tries to connect 
to vhost-user, but vhost-user is not up yet for some reason (startup timing, 
vhost-user crash, live migration, etc.), the guest should be able to complete 
it's startup without waiting for vhost-user, and then complete the connections 
async when vhost-user is up.

Comment 1 Peter Ginchev 2017-01-12 11:51:31 UTC
The current RHEL 7.3 used libvirtd version 2.0.0 and QEMU version 2.6, below are proposed patches that adds 'nowait' functionality:

QEMU:
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 1b9e73a..aaa223e 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -239,6 +239,7 @@ static int net_vhost_chardev_opts(void *opaque,
     } else if (strcmp(name, "path") == 0) {
         props->is_unix = true;
     } else if (strcmp(name, "server") == 0) {
+    } else if (strcmp(name, "wait") == 0) {
     } else {
         error_setg(errp,
                    "vhost-user does not support a chardev with option %s=%s",

LIBVIRT:
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7eb6c0a..7708c90 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7668,7 +7668,7 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd,
     case VIR_DOMAIN_CHR_TYPE_UNIX:
         virBufferAsprintf(&chardev_buf, "socket,id=char%s,path=%s%s",
                           net->info.alias, net->data.vhostuser->data.nix.path,
-                          net->data.vhostuser->data.nix.listen ? ",server" : "");
+                          net->data.vhostuser->data.nix.listen ? ",server,nowait" : "");
         break;

     case VIR_DOMAIN_CHR_TYPE_NULL:
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
index 3229034..f65ead8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
@@ -19,7 +19,7 @@ QEMU_AUDIO_DRV=none \
 -usb \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
+-chardev socket,id=charnet0,path=/tmp/vhost0.sock,server,nowait \
 -netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
 addr=0x3 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
index a9989b8..df334b1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
@@ -19,7 +19,7 @@ QEMU_AUDIO_DRV=none \
 -usb \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
+-chardev socket,id=charnet0,path=/tmp/vhost0.sock,server,nowait \
 -netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
 addr=0x3 \

Comment 2 Peter Ginchev 2017-01-12 11:54:25 UTC
LIBVIRT fix is relevant for all, but QEMU is specific for 2.6, 'master' branch of QEMU drops chardev parameters validation in the way it is done in 2.6, so QEMU master doesn't need a fix

Should I open a new bug for libvirt fix?

Comment 3 Victor Kaplansky 2017-01-12 15:50:54 UTC
Hi Peter,

So what do you say is, passing "nowait" as the socket param solves the bug, and the only problem from the QEMU point of view is the ned to validate "nowait" as a legal parameter. Right?

If so, it is still not clear to me why you propose to check in net/vhost-user.c
+    } else if (strcmp(name, "wait") == 0) {
for "wait" instead of "nowait"...


-- 
Victor

Comment 4 Peter Ginchev 2017-01-16 08:29:31 UTC
Hi Victor,
After our phone conversation,
I can confirm that I did test vhost-user socket connected at a much later time.
The interface is set up correctly and packets do pass.


Note You need to log in before you can comment on or make changes to this bug.