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 1266982 - libvirt should emit warning/error if vhostuser network device is used, but shared memory is not configured
Summary: libvirt should emit warning/error if vhostuser network device is used, but sh...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-28 17:52 UTC by Aaron Conole
Modified: 2016-11-03 18:25 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:25:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Aaron Conole 2015-09-28 17:52:04 UTC
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:
100%

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 11:54:19 UTC
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 19:06:30 UTC
"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 09:04:03 UTC
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 15:16:04 UTC
"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 15:25:43 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2015-December/msg00306.html

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

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

    qemu: Warn when using vhost-user without shared memory

Comment 9 chhu 2016-08-15 08:27:03 UTC
Verified with packages:
qemu-kvm-rhev-2.6.0-19.el7.x86_64
libvirt-2.0.0-4.el7.x86_64

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'>
  <name>r7</name>
  <uuid>ea6b3d7e-eb8e-42df-8b32-e8101d887983</uuid>
  <memory unit='KiB'>1024000</memory>
  <currentMemory unit='KiB'>1024000</currentMemory>
  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='0'/>
    </hugepages>
  </memoryBacking>
  <vcpu placement='static'>5</vcpu>
  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>
......
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <numa>
      <cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
    </numa>
  </cpu>
......
    <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'/>
    </interface>

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 18:25:21 UTC
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.

https://rhn.redhat.com/errata/RHSA-2016-2577.html


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