Open griwes opened 1 month ago
The current API in this crate doesn't allow for that, as it always passes a string into the C bindings
Fixed 5bbe44a2fac251326a2816b84c6db5825e981d19
I'd be happy with just an additional function that invokes the bindings with a reasonable set of arguments to achieve this, but I'm not sure if that's the right design for such an interface in general.
It’s probably a good idea to redesign this function with a builder:
c.create()
.template("download")
.flag(lxc::CreateFlags::QUIET)
.arg("-d")
.arg("ubuntu")
.arg("-r")
.arg("trusty")
.arg("-a")
.arg("i386")
// or .args(&["-d", "ubuntu", "-r", "trusty", "-a", "i386"])
.build()
What do you think?
container.create
in the C bindings for LXC allows a user to pass in a null pointer instead of a template name for that argument; this is used for example when you runlxc-create -t none
, which allows creating a container, but without a rootfs (thus allowing for full customization of the container with config options).The current API in this crate doesn't allow for that, as it always passes a string into the C bindings. There should be a way to create a container without a rootfs. (I'd be happy with just an additional function that invokes the bindings with a reasonable set of arguments to achieve this, but I'm not sure if that's the right design for such an interface in general.)