mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 12:51:12 +00:00
442d6a0527
This allows a container-type domain to have exclusive access to one of the host's NICs. Wire <hostdev caps=net> with the lxc_controller - when moving the newly created veth devices into a new namespace, also look for any hostdev devices that should be moved. Note: once the container domain has been destroyed, there is no code that moves the interfaces back to the original namespace. This does happen, though, probably due to default cleanup on namespace destruction. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
41 lines
1.1 KiB
XML
41 lines
1.1 KiB
XML
<domain type='lxc'>
|
|
<name>demo</name>
|
|
<uuid>8369f1ac-7e46-e869-4ca5-759d51478066</uuid>
|
|
<memory unit='KiB'>500000</memory>
|
|
<currentMemory unit='KiB'>500000</currentMemory>
|
|
<vcpu placement='static'>1</vcpu>
|
|
<os>
|
|
<type arch='x86_64'>exe</type>
|
|
<init>/bin/sh</init>
|
|
</os>
|
|
<clock offset='utc'/>
|
|
<on_poweroff>destroy</on_poweroff>
|
|
<on_reboot>restart</on_reboot>
|
|
<on_crash>destroy</on_crash>
|
|
<devices>
|
|
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
|
<filesystem type='mount' accessmode='passthrough'>
|
|
<source dir='/root/container'/>
|
|
<target dir='/'/>
|
|
</filesystem>
|
|
<console type='pty'>
|
|
<target type='lxc' port='0'/>
|
|
</console>
|
|
<hostdev mode='capabilities' type='storage'>
|
|
<source>
|
|
<block>/dev/sdf1</block>
|
|
</source>
|
|
</hostdev>
|
|
<hostdev mode='capabilities' type='misc'>
|
|
<source>
|
|
<char>/dev/tty0</char>
|
|
</source>
|
|
</hostdev>
|
|
<hostdev mode='capabilities' type='net'>
|
|
<source>
|
|
<interface>eth0</interface>
|
|
</source>
|
|
</hostdev>
|
|
</devices>
|
|
</domain>
|