Skip to content

Commit

Permalink
Merge pull request #6 from nkapron/development
Browse files Browse the repository at this point in the history
virtme-ng-init: do not remount /run
  • Loading branch information
Andrea Righi authored Jan 2, 2024
2 parents 6ed126b + a764cc3 commit f3a737c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,21 @@ fn symlink_fds() {

fn mount_kernel_filesystems() {
for mount_info in KERNEL_MOUNTS {
// In the case where a rootfs is specified when launching virtme-ng, it
// mounts /run and /run/virtme/guesttools prior to executing
// virtme-ng-init. We do not want to re-mount /run, as we will lose
// access to guesttools, which is required for network setup.
//
// Note, get_test_tools_dir() relies on /proc, so that must be mounted
// prior to /run.
if mount_info.target == "/run" {
if let Some(guest_tools_dir) = get_guest_tools_dir() {
if guest_tools_dir.starts_with("/run") {
log!("/run previously mounted, skipping");
continue;
}
}
}
utils::do_mount(
mount_info.source,
mount_info.target,
Expand Down

0 comments on commit f3a737c

Please sign in to comment.