gevico/machina
Vedi su GitHub[Open Source Workshop] Warn when -device is ignored on non-Unix or for unsupported devices
Open
#85 aperta il 25 apr 2026
buggood first issuehelp wanted
Metriche repository
- Star
- (31 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Problem Description
In src/main.rs lines 192-203, the -device handler only enables virtio-net-device on Unix platforms:
"-device" => {
let val = args.get(i).ok_or("-device requires argument")?;
#[cfg(unix)]
if val.starts_with("virtio-net-device,") {
cli.device_net_raw = Some(val.clone());
}
let _ = val;
}
On Windows or other non-Unix platforms, a user passing -device virtio-net-device,netdev=net0 has the device silently dropped with no warning.
Even on Unix platforms, unsupported device names such as virtio-blk-device are silently ignored.
Expected Behavior
- On non-Unix platforms, when
-deviceis specified, print a warning explaining that the device type is unsupported on that platform. - On Unix platforms, print a warning for unsupported device names.
Affected Files
src/main.rslines 192-203
Difficulty Notes
This only requires adding conditional branches and eprintln! warnings.