pub struct Options {
    socket: String,
    tag: String,
    shared_dir: PathBuf,
    uid_map: Option<String>,
    gid_map: Option<String>,
    cfg: Option<Config>,
    uid: u32,
    gid: u32,
}
Expand description

FS Device

Fields§

§socket: String

path to a vhost-user socket

§tag: String

the virtio-fs tag

§shared_dir: PathBuf

path to a directory to share

§uid_map: Option<String>

uid map to use

§gid_map: Option<String>

gid map to use

§cfg: Option<Config>

colon-separated options for configuring a directory to be shared with the VM through virtio-fs. The format is the same as crosvm run --shared-dir flag except only the keys related to virtio-fs are valid here.

§uid: u32

uid of the device process in the new user namespace created by minijail. These two options (uid/gid) are useful when the crosvm process cannot get CAP_SETGID/CAP_SETUID but an identity mapping of the current user/group between the VM and the host is required. Say the current user and the crosvm process has uid 5000, a user can use “uid=5000” and “uidmap=5000 5000 1” such that files owned by user 5000 still appear to be owned by user 5000 in the VM. These 2 options are useful only when there is 1 user in the VM accessing shared files. If multiple users want to access the shared file, gid/uid options are useless. It’d be better to create a new user namespace and give CAP_SETUID/CAP_SETGID to the crosvm. Default: 0.

§gid: u32

gid of the device process in the new user namespace created by minijail. Default: 0.

Trait Implementations§

source§

impl FromArgs for Options

source§

fn from_args(__cmd_name: &[&str], __args: &[&str]) -> Result<Self, EarlyExit>

Construct the type from an input set of arguments. Read more
source§

fn redact_arg_values( __cmd_name: &[&str], __args: &[&str] ) -> Result<Vec<String>, EarlyExit>

Get a String with just the argument names, e.g., options, flags, subcommands, etc, but without the values of the options and arguments. This can be useful as a means to capture anonymous usage statistics without revealing the content entered by the end user. Read more
source§

impl SubCommand for Options

source§

const COMMAND: &'static CommandInfo = _

Information about the subcommand.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> SubCommands for Twhere T: SubCommand,

§

const COMMANDS: &'static [&'static CommandInfo<'static>] = &[T::COMMAND]

Info for the commands.
§

fn dynamic_commands() -> &'static [&'static CommandInfo<'static>]

Get a list of commands that are discovered at runtime.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V