Expand description
Native bindings for lxc library.
§Examples
use std::ffi::CString;
fn main() {
let name = CString::new("playground").unwrap();
let configpath = CString::new("/path/to/config").unwrap();
let c = unsafe {
lxc_sys2::lxc_container_new(
name.as_ptr(),
configpath.as_ptr(),
)
};
let c_defined = unsafe { ((*c).is_defined)(c) };
println!(
"Container {:?} is defined: {}",
name,
c_defined
)
}
§Versioning
Version lxc-sys2:1.0.0
correspondents to lxc:1.0.0
. In case the bindings
had a bug a new version lxc-sys2:1.0.0-1
will be released which still
correspondents to lxc:1.0.0
including the patch to fix the binding
related bug.
Structs§
- bdev_
specs - lxc_
attach_ command_ t - Representation of a command to run in a container.
- lxc_
attach_ options_ t - LXC attach options for \ref lxc_container
attach()
. - lxc_
container - An LXC container.
- lxc_
lock - lxc_
snapshot - An LXC container snapshot.
Enums§
- lxc_
attach_ env_ policy_ t - LXC environment policy
Constants§
- LXC_
ATTACH_ DEFAULT - Mask of flags to apply by default
- LXC_
ATTACH_ DROP_ CAPABILITIES - Drop capabilities
- LXC_
ATTACH_ LSM - All Linux Security Module flags
- LXC_
ATTACH_ LSM_ EXEC - Execute under a Linux Security Module
- LXC_
ATTACH_ LSM_ NOW - FIXME: unknown
- LXC_
ATTACH_ MOVE_ TO_ CGROUP - Move to cgroup
- LXC_
ATTACH_ REMOUNT_ PROC_ SYS - Remount /proc filesystem
- LXC_
ATTACH_ SET_ PERSONALITY - Set personality
- LXC_
CLONE_ KEEPBDEVTYPE - Use the same bdev type
- LXC_
CLONE_ KEEPMACADDR - Do not change the MAC address on network interfaces
- LXC_
CLONE_ KEEPNAME - Do not edit the rootfs to change the hostname
- LXC_
CLONE_ MAXFLAGS - Number of
LXC_CLONE_*
flags - LXC_
CLONE_ MAYBE_ SNAPSHOT - Snapshot only if bdev supports it, else copy
- LXC_
CLONE_ SNAPSHOT - Snapshot the original filesystem(s)
- LXC_
CREATE_ MAXFLAGS - Number of
LXC_CREATE*
flags - LXC_
CREATE_ QUIET - Redirect
stdin
to/dev/zero
andstdout
andstderr
to/dev/null
Functions§
- list_
active_ ⚠containers - Get a list of active containers for a given lxcpath.
- list_
all_ ⚠containers - Get a complete list of all containers for a given lxcpath.
- list_
defined_ ⚠containers - Get a list of defined containers in a lxcpath.
- lxc_
attach_ ⚠run_ command - Run a command in the container.
- lxc_
attach_ ⚠run_ shell - Run a shell command in the container.
- lxc_
container_ ⚠get - Add a reference to the specified container.
- lxc_
container_ ⚠new - Create a new container.
- lxc_
container_ ⚠put - Drop a reference to the specified container.
- lxc_
get_ ⚠global_ config_ item - Get the value for a global config key
- lxc_
get_ ⚠version - Determine version of LXC.
- lxc_
get_ ⚠wait_ states - Obtain a list of all container states.
Type Aliases§
- lxc_
attach_ exec_ t - LXC attach function type.