Skip to content

Commit

Permalink
remove device field from the partition config
Browse files Browse the repository at this point in the history
This field was not used at all in the codebase, having it in the config
is misleading. Further on, it seems that there is no point in having it:
device files can be mounted through the mount option already.

Maybe we can eventually build something where for each partition
with at least one device mount we run `udevadm wait --settle <device>
[<device>]...` in a satellite thread, and we re-mount a device when it
pops back. That way we can re-attach a device without restarting the
hypervisor.

Further discussion in #80
  • Loading branch information
wucke13 committed Jul 14, 2023
1 parent 50a123d commit 9885334
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions hypervisor/src/hypervisor/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,31 +122,18 @@ pub struct Partition {
/// Path to the executable of the partition
pub image: PathBuf,

/// Devices to be mounted into the partitions namespace
///
/// Use this to pass devices into the partition, i. e. to get access to a
/// physical serial port.
#[serde(default)]
pub devices: Vec<Device>,

// TODO
#[serde(default)]
pub hm_table: PartitionHMTable,

/// Bindmounts from host to partition
///
/// Use this to expose a path from the host environment inside of a
/// partitions mnt namespace
/// Use this to expose a path / file / device file from the host environment
/// to the inside of a partitions.
#[serde(default)]
pub mounts: Vec<(PathBuf, PathBuf)>,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Device {
pub path: PathBuf,
pub read_only: bool,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum Channel {
Queuing(QueuingChannelConfig),
Expand Down

0 comments on commit 9885334

Please sign in to comment.