-
Notifications
You must be signed in to change notification settings - Fork 21
Virtio blk #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Virtio blk #36
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -25,9 +25,9 @@ percpu = { version = "0.2.0", features = ["arm-el2"] } | |||
| # System dependent modules provided by ArceOS-Hypervisor. | ||||
| axvcpu = "0.1" | ||||
| axaddrspace = "0.1" | ||||
| axdevice = { git = "https://github.com/arceos-hypervisor/axdevice.git" } | ||||
| axdevice = { git = "https://github.com/DINGBROK423/axdevice.git", branch = "virt-blk", default-features = false } | ||||
| axdevice_base = "0.1" | ||||
| axvmconfig = { version = "0.1", default-features = false } | ||||
| axvmconfig = { git = "https://github.com/DINGBROK423/axvmconfig.git", branch = "merge_add_virtio_mmio", default-features = false } | ||||
|
|
||||
| [target.'cfg(target_arch = "x86_64")'.dependencies] | ||||
| x86_vcpu = "0.1" | ||||
|
|
@@ -40,5 +40,5 @@ arm_vcpu = { git = "https://github.com/arceos-hypervisor/arm_vcpu", branch = "ne | |||
| arm_vgic = { version = "0.1", features = ["vgicv3"] } | ||||
|
|
||||
| [patch.crates-io] | ||||
| axvmconfig = { git = "https://github.com/arceos-hypervisor/axvmconfig.git", branch = "next" } | ||||
| axvmconfig = { git = "https://github.com/DINGBROK423/axvmconfig.git", branch = "merge_add_virtio_mmio", default-features = false } | ||||
|
||||
| axvmconfig = { git = "https://github.com/DINGBROK423/axvmconfig.git", branch = "merge_add_virtio_mmio", default-features = false } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ use axaddrspace::GuestPhysAddr; | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| pub use axvmconfig::{ | ||||||||||||||||||||||||||||||
| AxVMCrateConfig, EmulatedDeviceConfig, PassThroughAddressConfig, PassThroughDeviceConfig, | ||||||||||||||||||||||||||||||
| VMInterruptMode, VMType, VmMemConfig, VmMemMappingType, | ||||||||||||||||||||||||||||||
| VMInterruptMode, VMType, VmMemConfig, VmMemMappingType, VirtioBlkMmioDeviceConfig, | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // /// A part of `AxVCpuConfig`, which represents an architecture-dependent `VCpu`. | ||||||||||||||||||||||||||||||
|
|
@@ -53,7 +53,9 @@ pub struct AxVMConfig { | |||||||||||||||||||||||||||||
| pub(crate) phys_cpu_ls: PhysCpuList, | ||||||||||||||||||||||||||||||
| pub cpu_config: AxVCpuConfig, | ||||||||||||||||||||||||||||||
| pub image_config: VMImageConfig, | ||||||||||||||||||||||||||||||
| memory_regions: Vec<VmMemConfig>, | ||||||||||||||||||||||||||||||
| emu_devices: Vec<EmulatedDeviceConfig>, | ||||||||||||||||||||||||||||||
| virtio_blk_mmio: Vec<VirtioBlkMmioDeviceConfig>, | ||||||||||||||||||||||||||||||
| pass_through_devices: Vec<PassThroughDeviceConfig>, | ||||||||||||||||||||||||||||||
| excluded_devices: Vec<Vec<String>>, | ||||||||||||||||||||||||||||||
| pass_through_addresses: Vec<PassThroughAddressConfig>, | ||||||||||||||||||||||||||||||
|
|
@@ -83,8 +85,9 @@ impl From<AxVMCrateConfig> for AxVMConfig { | |||||||||||||||||||||||||||||
| dtb_load_gpa: cfg.kernel.dtb_load_addr.map(GuestPhysAddr::from), | ||||||||||||||||||||||||||||||
| ramdisk_load_gpa: cfg.kernel.ramdisk_load_addr.map(GuestPhysAddr::from), | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| // memory_regions: cfg.kernel.memory_regions, | ||||||||||||||||||||||||||||||
| memory_regions: cfg.kernel.memory_regions, | ||||||||||||||||||||||||||||||
| emu_devices: cfg.devices.emu_devices, | ||||||||||||||||||||||||||||||
| virtio_blk_mmio: cfg.devices.virtio_blk_mmio.unwrap_or_default(), | ||||||||||||||||||||||||||||||
| pass_through_devices: cfg.devices.passthrough_devices, | ||||||||||||||||||||||||||||||
| excluded_devices: cfg.devices.excluded_devices, | ||||||||||||||||||||||||||||||
| pass_through_addresses: cfg.devices.passthrough_addresses, | ||||||||||||||||||||||||||||||
|
|
@@ -133,15 +136,15 @@ impl AxVMConfig { | |||||||||||||||||||||||||||||
| pub fn pass_through_addresses(&self) -> &Vec<PassThroughAddressConfig> { | ||||||||||||||||||||||||||||||
| &self.pass_through_addresses | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| // /// Returns configurations related to VM memory regions. | ||||||||||||||||||||||||||||||
| // pub fn memory_regions(&self) -> Vec<VmMemConfig> { | ||||||||||||||||||||||||||||||
| // &self.memory_regions | ||||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||||
| /// Returns configurations related to VM memory regions. | ||||||||||||||||||||||||||||||
| pub fn memory_regions(&self) -> &Vec<VmMemConfig> { | ||||||||||||||||||||||||||||||
| &self.memory_regions | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // /// Adds a new memory region to the VM configuration. | ||||||||||||||||||||||||||||||
| // pub fn add_memory_region(&mut self, region: VmMemConfig) { | ||||||||||||||||||||||||||||||
| // self.memory_regions.push(region); | ||||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||||
| /// Adds a new memory region to the VM configuration. | ||||||||||||||||||||||||||||||
| pub fn add_memory_region(&mut self, region: VmMemConfig) { | ||||||||||||||||||||||||||||||
| self.memory_regions.push(region); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+139
to
+147
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // /// Checks if the VM memory regions contain a specific range. | ||||||||||||||||||||||||||||||
| // pub fn contains_memory_range(&self, range: &Range<usize>) -> bool { | ||||||||||||||||||||||||||||||
|
|
@@ -155,6 +158,11 @@ impl AxVMConfig { | |||||||||||||||||||||||||||||
| &self.emu_devices | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Returns configurations related to Virtio-blk MMIO devices. | ||||||||||||||||||||||||||||||
| pub fn virtio_blk_mmio(&self) -> &Vec<VirtioBlkMmioDeviceConfig> { | ||||||||||||||||||||||||||||||
| &self.virtio_blk_mmio | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// Returns configurations related to VM passthrough devices. | ||||||||||||||||||||||||||||||
| pub fn pass_through_devices(&self) -> &Vec<PassThroughDeviceConfig> { | ||||||||||||||||||||||||||||||
| &self.pass_through_devices | ||||||||||||||||||||||||||||||
|
|
@@ -189,6 +197,10 @@ impl AxVMConfig { | |||||||||||||||||||||||||||||
| pub fn interrupt_mode(&self) -> VMInterruptMode { | ||||||||||||||||||||||||||||||
| self.interrupt_mode | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| /// Returns the vCPU-to-pCPU affinity information for this VM. | |
| /// | |
| /// Each element in the returned vector is a tuple of | |
| /// `(vcpu_index, pcpu_id, pcpu_set_index)`: | |
| /// - `vcpu_index`: the index of the vCPU within this VM. | |
| /// - `pcpu_id`: an optional physical CPU identifier; `None` means the vCPU | |
| /// is not pinned to a specific physical CPU. | |
| /// - `pcpu_set_index`: the index into the configured physical CPU set that | |
| /// this vCPU is associated with. | |
| /// | |
| /// This is a convenience wrapper around the underlying physical CPU list, | |
| /// intended for callers that need to inspect or configure vCPU pinning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependencies are pointing to personal GitHub forks (DINGBROK423) instead of the official arceos-hypervisor organization repositories. For production use, these should point to stable, official releases or the main organization repositories to ensure maintenance, stability, and trustworthiness of the dependencies.