mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
Pass work dir to vm-manager for container volume compatibility
Configure vm-manager's QEMU backend to use /var/lib/solstice-ci as the data directory (matching the compose.yml volume mount) instead of the default ~/.local/share/vmctl/vms/ path.
This commit is contained in:
parent
b5c7078adc
commit
b5ccd4e2aa
2 changed files with 10 additions and 5 deletions
|
|
@ -186,7 +186,12 @@ async fn main() -> Result<()> {
|
||||||
let capacity_map = parse_capacity_map(opts.capacity_map.as_deref());
|
let capacity_map = parse_capacity_map(opts.capacity_map.as_deref());
|
||||||
|
|
||||||
// Build hypervisor via vm-manager adapter (QEMU direct, no libvirt)
|
// Build hypervisor via vm-manager adapter (QEMU direct, no libvirt)
|
||||||
let router = vm_adapter::VmManagerAdapter::build(opts.network_bridge.clone());
|
// Work dir for VM overlays, QEMU sockets, and console logs.
|
||||||
|
// Defaults to /var/lib/solstice-ci (matches compose.yml volume mount).
|
||||||
|
let work_dir = Some(PathBuf::from(
|
||||||
|
std::env::var("ORCH_WORK_DIR").unwrap_or_else(|_| "/var/lib/solstice-ci".to_string()),
|
||||||
|
));
|
||||||
|
let router = vm_adapter::VmManagerAdapter::build(opts.network_bridge.clone(), work_dir);
|
||||||
|
|
||||||
// Initialize persistence (optional). Skip when requested for faster startup.
|
// Initialize persistence (optional). Skip when requested for faster startup.
|
||||||
let persist = if opts.skip_persistence {
|
let persist = if opts.skip_persistence {
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,15 @@ pub struct VmManagerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VmManagerAdapter {
|
impl VmManagerAdapter {
|
||||||
/// Build a new adapter. Uses user-mode networking (SLIRP) for
|
|
||||||
/// containerization-friendly operation — no libvirt or bridge needed.
|
|
||||||
/// Build a new adapter.
|
/// Build a new adapter.
|
||||||
///
|
///
|
||||||
/// `bridge` — optional bridge name for TAP networking (e.g. `"virbr0"`).
|
/// `bridge` — optional bridge name for TAP networking (e.g. `"virbr0"`).
|
||||||
/// If `None`, uses user-mode (SLIRP) networking with SSH port forwarding.
|
/// If `None`, uses user-mode (SLIRP) networking with SSH port forwarding.
|
||||||
pub fn build(bridge: Option<String>) -> Self {
|
/// `work_dir` — directory for VM overlays, sockets, and console logs.
|
||||||
|
/// Defaults to `~/.local/share/vmctl/vms/` if `None`.
|
||||||
|
pub fn build(bridge: Option<String>, work_dir: Option<PathBuf>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
inner: vm_manager::RouterHypervisor::new(bridge, None),
|
inner: vm_manager::RouterHypervisor::with_data_dir(bridge, None, work_dir),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue