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 1111044 - capabilities mode hostdev shouldn't be added in KVM
Summary: capabilities mode hostdev shouldn't be added in KVM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-19 06:34 UTC by Jincheng Miao
Modified: 2015-03-05 07:37 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:37:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Jincheng Miao 2014-06-19 06:34:34 UTC
Description of problem:
capabilities mode hostdev shouldn't be defined in KVM.

From libvirt.org:
"
Block / character devices from the host can be passed through to the guest using the hostdev element.
This is only possible with container based virtualization. since after 1.0.1 for LXC
"
We can see this capabilities mode is only for container based virtualization, like LXC. So for KVM, this hostdev shouldn't be defined.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. add capabilities mode hostdev to a inactive domain:
# virsh edit r6
...
    <hostdev mode='capabilities' type='storage'>
      <source>
        <block>/dev/sdb3</block>
      </source>
    </hostdev>
...

2. start domain
# virsh start r6

3. this hostdev is not working actually, no effect for KVM domain.
The storage can't be listed in guest:
# lspci


Expected result:
libvirtd should forbid to add capabilities mode hostdev to KVM domain.

Comment 1 Pavel Hrdina 2014-06-26 09:01:32 UTC
Fixed in upstream:

commit 01e508f33c3b94bafe3e266bfd45b070fae8c8c0
Author: Jincheng Miao <jmiao>
Date:   Wed Jun 25 14:45:59 2014 +0800

    enhance hostdev mode 'capabilities' process
    
    Currently, only LXC has hostdev mode 'capabilities' support,
    so the other drivers should forbid to define it in XML.
    The hostdev mode check is added to devicesPostParseCallback()
    for each hypervisor driver.
    
    But there are some drivers lack function devicesPostParseCallback(),
    so only add check for qemu, libxl, openvz, uml, xen, xenapi.
    
    Signed-off-by: Jincheng Miao <jmiao>

Comment 3 lcheng 2014-11-18 08:31:17 UTC
Verify it as follows. The result is expected.


Version:
libvirt-1.2.8-7.el7.x86_64
qemu-kvm-1.5.3-79.el7.x86_64
qemu-kvm-rhev-2.1.2-8.el7


Steps:
Add the following content to a inactive domain.
    <hostdev mode='capabilities' type='storage'>
      <source>
        <block>/dev/sdb3</block>
      </source>
    </hostdev>


# virsh edit a
error: unsupported configuration: hostdev mode 'capabilities' is not supported in kvm
Failed. Try again? [y,n,f,?]:

Comment 5 errata-xmlrpc 2015-03-05 07:37:50 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-2015-0323.html


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