Skip to content

Commit

Permalink
Meta: Add a modifier to 'slow-emulator' commandline argument
Browse files Browse the repository at this point in the history
  • Loading branch information
corigan01 committed Jan 29, 2025
1 parent c644bd1 commit 0505160
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions meta/src/cmdline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub struct CommandLine {
#[arg(short, long = "nographic", default_value_t = false)]
pub no_graphic: bool,

/// Slow down the emulator
#[arg(short, long = "slow", default_value_t = false)]
pub slow_emulator: bool,
/// Slow down the emulator with a modifier
#[arg(short, long = "slow")]
pub slow_emulator: Option<usize>,

/// Use the bochs emulator
#[arg(short, long = "bochs", default_value_t = false)]
Expand Down
6 changes: 3 additions & 3 deletions meta/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn run_qemu(
enable_kvm: bool,
enable_no_graphic: bool,
log_interrupts: bool,
slow_emu: bool,
slow_emu: Option<usize>,
use_gdb: bool,
quick_boot: Option<QuickBootImages>,
) -> Result<()> {
Expand All @@ -135,8 +135,8 @@ fn run_qemu(
} else {
&["-d", "cpu_reset"]
};
let slow_emulator: &[&str] = if slow_emu {
&["-icount", "10,align=on"]
let slow_emulator: &[&str] = if let Some(modify) = slow_emu {
&["-icount", &format!("{},align=on", modify)]
} else {
&[]
};
Expand Down

0 comments on commit 0505160

Please sign in to comment.