module documentation
KVM hypervisor tap device helpers
Function |
|
Open a new tap device and return its file descriptor. |
Constant | IFF |
Undocumented |
Constant | IFF |
Undocumented |
Constant | IFF |
Undocumented |
Constant | IFF |
Undocumented |
Constant | IFF |
Undocumented |
Constant | TUNGETFEATURES |
Undocumented |
Constant | TUNGETIFF |
Undocumented |
Constant | TUNSETIFF |
Undocumented |
Function | _ |
Retrieves supported TUN features from file descriptor. |
Function | _ |
Check whether to enable the IFF_MULTI_QUEUE flag. |
Function | _ |
Check whether to enable the IFF_VNET_HDR flag. |
Open a new tap device and return its file descriptor.
This is intended to be used by a qemu-type hypervisor together with the -net tap,fd=<fd> or -net tap,fds=x:y:...:z command line parameter.
Parameters | |
name:string | name for the TAP interface being created; if an empty string is passed, the OS will generate a unique name |
features:dict | A dict denoting whether vhost, vnet_hdr, mq netdev features are enabled or not. |
Returns | |
tuple | (ifname, [tapfds], [vhostfds]) |
Check whether to enable the IFF_MULTI_QUEUE flag.
This flag was introduced in Linux kernel 3.8.
Parameters | |
fd:int | the file descriptor of /dev/net/tun |
_features | Undocumented |
Check whether to enable the IFF_VNET_HDR flag.
To do this, _all_ of the following conditions must be met:
- TUNGETFEATURES ioctl() *must* be implemented
- TUNGETFEATURES ioctl() result *must* contain the IFF_VNET_HDR flag
- TUNGETIFF ioctl() *must* be implemented; reading the kernel code in drivers/net/tun.c there is no way to test this until after the tap device has been created using TUNSETIFF, and there is no way to change the IFF_VNET_HDR flag after creating the interface, catch-22! However both TUNGETIFF and TUNGETFEATURES were introduced in kernel version 2.6.27, thus we can expect TUNGETIFF to be present if TUNGETFEATURES is.
Parameters | |
fd:int | the file descriptor of /dev/net/tun |
_features | Undocumented |