Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/qemu-aarch64.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ args = [
"8g",
]
fail_regex = []
success_regex = ["Hello, world!"]
success_regex = [
"Hello, world!",
"test pass!",
]
to_bin = true
uefi = false
4 changes: 4 additions & 0 deletions .github/workflows/test-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
vmconfigs: configs/vms/arceos-aarch64-qemu-smp1.toml
vmconfigs_name: ArceOS
vmimage_name: qemu_aarch64_arceos
- arch: aarch64
vmconfigs: configs/vms/linux-aarch64-qemu-smp1.toml
vmconfigs_name: Linux
vmimage_name: qemu_aarch64_linux
# - arch: riscv64
# vmconfigs: configs/vms/arceos-riscv64-qemu-smp1.toml
# vmconfigs_name: ArceOS
Expand Down
2 changes: 1 addition & 1 deletion configs/vms/linux-aarch64-qemu-smp1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dtb_load_addr = 0x8000_0000
# Memory regions with format (`base_paddr`, `size`, `flags`, `map_type`).
# For `map_type`, 0 means `MAP_ALLOC`, 1 means `MAP_IDENTICAL`.
memory_regions = [
[0x8000_0000, 0x1000_0000, 0x7, 0], # System RAM 1G MAP_IDENTICAL
[0x8000_0000, 0x1000_0000, 0x7, 1], # System RAM 1G MAP_IDENTICAL
]

#
Expand Down
2 changes: 2 additions & 0 deletions kernel/src/shell/command/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ macro_rules! print_err {
}

// Helper function: split whitespace
#[cfg(feature = "fs")]
fn split_whitespace(s: &str) -> (&str, &str) {
let s = s.trim();
if let Some(pos) = s.find(char::is_whitespace) {
Expand Down Expand Up @@ -587,6 +588,7 @@ fn file_type_to_char(ty: FileType) -> char {
}

#[rustfmt::skip]
#[cfg(feature = "fs")]
const fn file_perm_to_rwx(mode: u32) -> [u8; 9] {
let mut perm = [b'-'; 9];
macro_rules! set {
Expand Down
4 changes: 3 additions & 1 deletion kernel/src/shell/command/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::fs::read_to_string;

use crate::{
shell::command::{CommandNode, FlagDef, OptionDef, ParsedCommand},
vmm::{add_running_vm_count, config::init_guest_vm, vcpus, vm_list, with_vm},
vmm::{add_running_vm_count, vcpus, vm_list, with_vm},
};

/// Check if a VM can transition to Running state.
Expand Down Expand Up @@ -124,6 +124,7 @@ fn vm_create(cmd: &ParsedCommand) {
for config_path in args.iter() {
println!("Creating VM from config: {}", config_path);

use crate::vmm::config::init_guest_vm;
match read_to_string(config_path) {
Ok(raw_cfg) => match init_guest_vm(&raw_cfg) {
Ok(vm_id) => {
Expand Down Expand Up @@ -767,6 +768,7 @@ fn delete_vm_by_id(vm_id: usize, keep_data: bool) {
println!("✓ VM[{}] deletion completed", vm_id);
}

#[cfg(feature = "fs")]
fn vm_list_simple() {
let vms = vm_list::get_vm_list();
println!("ID NAME STATE VCPU MEMORY");
Expand Down
4 changes: 0 additions & 4 deletions kernel/src/vmm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ pub fn with_vm_and_vcpu_on_pcpu(
// }))
}

pub fn get_running_vm_count() -> usize {
RUNNING_VM_COUNT.load(Ordering::Acquire)
}

pub fn add_running_vm_count(count: usize) {
RUNNING_VM_COUNT.fetch_add(count, Ordering::Release);
}
Expand Down
9 changes: 4 additions & 5 deletions xtask/src/tbuld.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ impl Context {
}

if !vm_config_paths.is_empty() {
let value = vm_config_paths
.iter()
.map(|p| format!("{}", p.display()))
.collect::<Vec<_>>()
.join(";");
let value = std::env::join_paths(&vm_config_paths)
.map_err(|e| anyhow::anyhow!("Failed to join VM config paths: {}", e))?
.to_string_lossy()
.into_owned();
cargo.env.insert("AXVISOR_VM_CONFIGS".to_string(), value);
}

Expand Down