Bug 1454174 - [RFE]: Add support for listing mediated devices to libvirt's node device driver
Summary: [RFE]: Add support for listing mediated devices to libvirt's node device driver
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Martin Polednik
QA Contact: meital avital
URL:
Whiteboard:
Depends On: 1452072
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-22 11:41 UTC by Jaroslav Suchanek
Modified: 2022-06-27 12:10 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 1452072
Environment:
Last Closed: 2017-07-26 06:58:39 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-46694 0 None None None 2022-06-27 12:10:30 UTC

Description Jaroslav Suchanek 2017-05-22 11:41:10 UTC
+++ This bug was initially created as a clone of Bug #1452072 +++

Description of problem:
libvirt supports mediated devices' framework since 3.2.0 but lacks the capability to list both pre-created mediated devices and their physical parent devices capable of creating mediated devices in virsh's nodedev-list output. The same goes for querying the XML definition of such devices.

Version-Release number of selected component (if applicable):
3.2.0


Actual results:
libvirt doesn't support mediated devices within it's node device driver

Expected results:
As the first stage of support, show the pre-created devices in the list of host devices as well as enable filtering of the host device list using flags (virsh nodedev-list --cap) both by mediated devices and devices capable of creating them.

Additional info:


--- Additional comment from Erik Skultety on 2017-05-18 14:05:02 CEST ---

Fixed upstream by commits:

commit 4385df97fed24279fa8595a1a49c9f9b3eba5be1
Refs: v3.3.0-92-g4385df97f
Author:     Erik Skultety <eskultet>
AuthorDate: Mon Mar 6 17:20:00 2017 +0100
Commit:     Erik Skultety <eskultet>
CommitDate: Thu May 18 12:20:15 2017 +0200

    nodedev: Introduce new mdev_types and mdev nodedev capabilities

    The reason for introducing two capabilities, one for the device itself
    (cap 'mdev') and one for the parent device listing the available types
    ('mdev_types'), is that we should be able to do
    'virsh nodedev-list --cap' not only for existing mdev devices but also
    for devices that support creation of mdev devices, since one day libvirt
    might be actually able to create the mdev devices in an automated way
    (just like we do for NPIV/vHBA).

    https://bugzilla.redhat.com/show_bug.cgi?id=1452072

    Signed-off-by: Erik Skultety <eskultet>


commit 500cbc066a5362834462c4eefb260b7c96a8554f
Refs: v3.3.0-93-g500cbc066
Author:     Erik Skultety <eskultet>
AuthorDate: Mon Mar 6 17:17:34 2017 +0100
Commit:     Erik Skultety <eskultet>
CommitDate: Thu May 18 12:21:33 2017 +0200

    nodedev: Introduce the mdev capability to a PCI parent device

    The parent device needs to report the generic stuff about the supported
    mediated devices types, like device API, available instances, type name,
    etc. Therefore this patch introduces a new nested capability element of
    type 'mdev_types' with the resulting XML of the following format:

    <device>
      ...
      <capability type='pci'>
        ...
	<capability type='mdev_types'>
          <type id='vendor_supplied_id'>
            <name>optional_vendor_supplied_codename</name>
            <deviceAPI>vfio-pci</deviceAPI>
            <availableInstances>NUM</availableInstances>
          </type>
            ...
          <type>
            ...
          </type>
        </capability>
      </capability>
      ...
    </device>

    https://bugzilla.redhat.com/show_bug.cgi?id=1452072

    Signed-off-by: Erik Skultety <eskultet>


commit 88ef73e13cddc8c0ff01dfe7a914342f8720c517
Refs: v3.3.0-94-g88ef73e13
Author:     Erik Skultety <eskultet>
AuthorDate: Mon Mar 6 17:18:48 2017 +0100
Commit:     Erik Skultety <eskultet>
CommitDate: Thu May 18 12:21:45 2017 +0200

    nodedev: Introduce mdev capability for mediated devices

    Start discovering the mediated devices on the host system and format the
    attributes for the mediated device into the XML. Compared to the parent
    device which reports generic information about the abstract mediated
    devices types, a child device only reports the type name it has been
    instantiated from and the IOMMU group number, since that's device
    specific compared to the rest of the info that can be gathered about
    mediated devices at the moment.
    This patch introduces both the formatting and parsing routines, updates
    nodedev.rng schema, adding a testcase as well.

    The resulting mdev child device XML:
    <device>
      <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01</name>
      <path>/sys/devices/.../4b20d080-1b54-4048-85b3-a6a62d165c01</path>
      <parent>pci_0000_06_00_0</parent>
      <driver>
        <name>vfio_mdev</name>
      </driver>
      <capability type='mdev'>
        <type id='vendor_supplied_type_id'/>
        <iommuGroup number='NUM'/>
      <capability/>
    <device/>

    https://bugzilla.redhat.com/show_bug.cgi?id=1452072

    Signed-off-by: Erik Skultety <eskultet>


commit a0a0b3cf71cbee1df40dd0fdebd7bb6a84682f09
Refs: [master], [mdev-nodedev-next], {origin/master}, {origin/HEAD}, v3.3.0-95-ga0a0b3cf7
Author:     Erik Skultety <eskultet>
AuthorDate: Wed Mar 29 12:36:31 2017 +0200
Commit:     Erik Skultety <eskultet>
CommitDate: Thu May 18 12:21:55 2017 +0200

    docs: Document the mediated devices within the nodedev driver

    https://bugzilla.redhat.com/show_bug.cgi?id=1452072

    Signed-off-by: Erik Skultety <eskultet>

--- Additional comment from Erik Skultety on 2017-05-18 14:06:10 CEST ---

Backport for 7.4 posted at: http://post-office.corp.redhat.com/archives/rhvirt-patches/2017-May/msg00612.html

Comment 4 Michal Skrivanek 2017-07-26 06:58:39 UTC
there doesn't seem to be any incentive to do that. We would be interested once libvirt provides the full description of the exposed modes and/or additional capabilities/monitoring of mediated devices(current usage, power, etc) but at this point those are not available yet


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