Red Hat Bugzilla – Bug 1266982
libvirt should emit warning/error if vhostuser network device is used, but shared memory is not configured
Last modified: 2016-11-03 14:25:21 EDT
Description of problem:
When starting a domain which is set to use a vhostuser, if hugepages are not configured to be shared in the numa config of the <cpu/> tag, network packets will not flow. However, it is possible to warn that this may happen (since the situation can be detected).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. build a libvirt domain which uses vhostuser and non-shared memory
2. bring up the domain (virsh start dom0)
3. domain boots
domain startup does not issue a warning that vhostuser interfaces do not have host-guest shared memory configured.
at least a warning should be issued that vhostuser interfaces require guest-host shared memory.
I don't think this should be handled in libvirt. We are trying to enable most of the options that the hypervisor supports. We cannot hence check if all settings make sense for each possible scenario. In this case the user can use different shared memory for the application. Whether this is part of bigger deployment or not, the management application (or user) should create configuration sensible for its use case.
Let me know if you disagree, but I'm most probably going to close this as a NOTABUG.
"In this case the user can use different shared memory for the application." I don't know what that means, can you explain? Without guest-host shared memory configured in the XML, what else can the user do for their vhostuser ports to start working? Is there some post-start command or switch? AFAIK, none exists - but if it does that would be good to know because it would mean no warning is needed. However, without such a post-start command or switch, the user has configured network interfaces which can never work.
Please let me know if I'm mistaken.
I think you might be able to use ivshmem for that as well (element <shmem/> in libvirt's XML), but even if not, that can happen in the future and we would limit user and ourselves in that regard. As a compromise, I think the best option would be to emit a warning in the log, so users searching for that will find it, but on the other hand it will not limit them in doing so. It *may* be also usable for testing, etc.
"As a compromise, I think the best option would be to emit a warning in the log,"
No compromise needed - the warning log is what I want :)
Patch proposed upstream:
Fixed upstream by v1.3.0-62-g686eb7a24f7d:
Author: Martin Kletzander <email@example.com>
Date: Tue Dec 8 14:15:47 2015 +0100
qemu: Warn when using vhost-user without shared memory
Verified with packages:
1. Start a VM with vhostuser network device but shared memory is not configured.
# virsh start r7
Domain r7 started
# virsh dumpxml r7
<domain type='kvm' id='6'>
<page size='2048' unit='KiB' nodeset='0'/>
<memory mode='strict' nodeset='0'/>
<cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
<source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
2. Check there is warning in the libvirtd.log:
2016-08-11 07:04:40.987+0000: 14130: debug : qemuProcessStartValidate:4390 : Checking for any possible (non-fatal) issues
2016-08-11 07:04:40.987+0000: 14130: warning : qemuProcessStartWarnShmem:4315 : Detected vhost-user interface without any shared memory, the interface might not be operational
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.