Bug 1266982 - libvirt should emit warning/error if vhostuser network device is used, but shared memory is not configured
libvirt should emit warning/error if vhostuser network device is used, but sh...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Martin Kletzander
Virtualization Bugs
: Upstream
Depends On:
  Show dependency treegraph
Reported: 2015-09-28 13:52 EDT by Aaron Conole
Modified: 2016-11-03 14:25 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-03 14:25:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Aaron Conole 2015-09-28 13:52:04 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):
libvirt 1.2.8
qemu-kvm 2.2.0

How reproducible:

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

Actual results:
domain startup does not issue a warning that vhostuser interfaces do not have host-guest shared memory configured.

Expected results:
at least a warning should be issued that vhostuser interfaces require guest-host shared memory.
Comment 2 Martin Kletzander 2015-11-12 06:54:19 EST
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.
Comment 3 Aaron Conole 2015-11-23 14:06:30 EST
"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.
Comment 4 Martin Kletzander 2015-11-24 04:04:03 EST
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.
Comment 5 Aaron Conole 2015-11-25 10:16:04 EST
"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 :)
Comment 6 Martin Kletzander 2015-12-08 10:25:43 EST
Patch proposed upstream:

Comment 7 Martin Kletzander 2015-12-14 05:36:23 EST
Fixed upstream by v1.3.0-62-g686eb7a24f7d:

commit 686eb7a24f7d71048f5cd45bb0095a63d0787875
Author: Martin Kletzander <mkletzan@redhat.com>
Date:   Tue Dec 8 14:15:47 2015 +0100

    qemu: Warn when using vhost-user without shared memory
Comment 9 chhu 2016-08-15 04:27:03 EDT
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'>
  <memory unit='KiB'>1024000</memory>
  <currentMemory unit='KiB'>1024000</currentMemory>
      <page size='2048' unit='KiB' nodeset='0'/>
  <vcpu placement='static'>5</vcpu>
    <memory mode='strict' nodeset='0'/>
  <cpu mode='host-model'>
    <model fallback='allow'/>
      <cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
    <interface type='vhostuser'>
      <mac address='52:54:00:bb:25:74'/>
      <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <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
Comment 11 errata-xmlrpc 2016-11-03 14:25:21 EDT
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.


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