Skip to content

Commit

Permalink
Merge #2521
Browse files Browse the repository at this point in the history
2521: [osx] fix old-style vmnet arguments r=townsend2010 a=Saviq



Co-authored-by: Michał Sawicz <[email protected]>
  • Loading branch information
2 people authored and Chris Townsend committed Apr 14, 2022
1 parent f5e9d1e commit 7338000
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/platform/backends/qemu/qemu_vm_process_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ QStringList mp::QemuVMProcessSpec::arguments() const
mpl::log(mpl::Level::info, desc.vm_name,
fmt::format("Cannot determine QEMU machine type. Falling back to system default."));
}

// need to fix old-style vmnet arguments
// TODO: remove in due time
args.replaceInStrings("vmnet-macos,mode=shared,", "vmnet-shared,");
}
else
{
Expand Down
11 changes: 11 additions & 0 deletions tests/qemu/test_qemu_vm_process_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ TEST_F(TestQemuVMProcessSpec, resume_with_missing_machine_type_guesses_correctly
EXPECT_EQ(spec.arguments(), QStringList({"-args", "-loadvm", "suspend_tag"}));
}

TEST_F(TestQemuVMProcessSpec, ResumeFixesVmnetFormat)
{
const mp::QemuVMProcessSpec::ResumeData resume_data{
"suspend_tag", "machine_type", false, {"vmnet-macos,mode=shared,foo"}};

mp::QemuVMProcessSpec spec(desc, platform_args, resume_data);

EXPECT_EQ(spec.arguments(),
QStringList({"vmnet-shared,foo", "-loadvm", "suspend_tag", "-machine", "machine_type"}));
}

TEST_F(TestQemuVMProcessSpec, apparmor_profile_has_correct_name)
{
mp::QemuVMProcessSpec spec(desc, platform_args, mp::nullopt);
Expand Down

0 comments on commit 7338000

Please sign in to comment.