]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add support for <hostdev mode="capabilities">
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 23 Nov 2012 13:50:29 +0000 (13:50 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 17 Dec 2012 17:50:50 +0000 (17:50 +0000)
commitaae0fc2a922b3e31dae7648c547fca2ac2587625
tree8ab6162305298e2e89ea977908073d5d0acfe30f
parent347a712ab19b33867efc1e58bcd2f3219271cd3f
Add support for <hostdev mode="capabilities">

The <hostdev> device type has long had a redundant "mode"
attribute, which has always been "subsys". This finally
introduces a new mode "capabilities", which will be used
by the LXC driver for device assignment. Since container
based virtualization uses a single kernel, the idea of
assigning physical PCI devices doesn't make sense. It is
still reasonable to assign USB devices, but for assigning
arbitrary nodes in /dev, the new 'capabilities' mode is
to be used.

The first capability support is 'storage', which is for
assignment of block devices. Functionally this is really
pretty similar to the <disk> support. The only difference
is the device node name is identical in both host and
container namespaces.

    <hostdev mode='capabilities' type='storage'>
      <source>
        <block>/dev/sdf1</block>
      </source>
    </hostdev>

The second capability support is 'misc', which is for
assignment of character devices. There is no existing
parallel to this. Again the device node is the same
inside & outside the container.

    <hostdev mode='capabilities' type='misc'>
      <source>
        <char>/dev/input/event3</char>
      </source>
    </hostdev>

The reason for keeping the char & storage devices
separate in the domain XML, is to mirror the split
in the node device XML. NB the node device XML does
not yet report character devices, but that's another
new patch to come

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_audit.c
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
tests/lxcxml2xmldata/lxc-hostdev.xml [new file with mode: 0644]
tests/lxcxml2xmltest.c