Re: [PATCH v2 2/2] nodedev: Expose PCI header type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 17, 2016 at 04:05:18PM +0000, Daniel P. Berrange wrote:
> On Thu, Mar 17, 2016 at 04:51:06PM +0100, Martin Kletzander wrote:
> > If we expose this information, which is one byte in every PCI config
> > file, we let all mgmt apps know whether the device itself is an endpoint
> > or not so it's easier for them to decide whether such device can be
> > passed through into a VM (endpoint) or not (*-bridge).
> > 
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1317531
> > 
> > Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
> > ---
> >  docs/schemas/nodedev.rng                           | 12 ++++++++
> >  src/conf/node_device_conf.c                        | 24 ++++++++++++++++
> >  src/conf/node_device_conf.h                        |  1 +
> >  src/libvirt_private.syms                           |  3 ++
> >  src/node_device/node_device_udev.c                 |  3 ++
> >  src/util/virpci.c                                  | 33 ++++++++++++++++++++++
> >  src/util/virpci.h                                  | 12 ++++++++
> >  .../pci_0000_00_02_0_header_type.xml               | 16 +++++++++++
> >  .../pci_0000_00_1c_0_header_type.xml               | 20 +++++++++++++
> >  tests/nodedevxml2xmltest.c                         |  2 ++
> >  10 files changed, 126 insertions(+)
> >  create mode 100644 tests/nodedevschemadata/pci_0000_00_02_0_header_type.xml
> >  create mode 100644 tests/nodedevschemadata/pci_0000_00_1c_0_header_type.xml
> > 
> > diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
> > index 744dccdf5fa9..33637546e48f 100644
> > --- a/docs/schemas/nodedev.rng
> > +++ b/docs/schemas/nodedev.rng
> > @@ -169,6 +169,18 @@
> >      </optional>
> > 
> >      <optional>
> > +      <element name='header'>
> > +        <attribute name='type'>
> > +          <choice>
> > +            <value>endpoint</value>
> > +            <value>pci-bridge</value>
> > +            <value>cardbus-bridge</value>
> > +          </choice>
> > +        </attribute>
> > +      </element>
> > +    </optional>
> 
> As before, I think we should be using a capability to express this
> not creating a new way to express capabilities without calling
> them capabilities.

Oh and I should say I don't think we need to express 'endpoint' as
a capability. It would suffice to justhave

  <capability type="pci">
      ...
      <capability type="pci-bridge"/>
      ...
  </capability>

or

  <capability type="pci">
      ...
      <capability type="cardbus-bridge"/>
      ...
  </capability>

Any device without one of those two would implicitly be an end point

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]