rust-vmm / vmm-reference

A VMM implementation based of rust-vmm components
Apache License 2.0
146 stars 61 forks source link

Add support for multiple virtio block devices #220

Open andreeaflorescu opened 2 years ago

andreeaflorescu commented 2 years ago

Once we integrate the vm-allocator (#132) we will be able to use more than one block & net device respectively. For this to work, we also need to make updates to the kernel command line on x86_64 to add multiple devices, and to the FDT on arm. Also, we need to update the virtio code for the devices because right now at least the block device works with the assumption that there is a single block on /dev/vda. The code that needs to be updated is here: https://github.com/rust-vmm/vmm-reference/tree/main/src/devices/src/virtio

We should add a python tests to check that these devices work. For Block device we could add a scratch device, check that writing in it works? other ideas are welcome

ramyak-mehra commented 1 year ago

I wanted to pick this back up again, Its been a long time since I last saw the codebase. Last when I was working on it, I remember it required changes at mainly 3 places

  1. Accepting multiple block devices something on the lines of --block path(Required) is_root, and is_ro
  2. Inside the vm.rs
  3. Inside the virtio block, to accept command line kernel info.

If I remember correctly only root device needs to passed to the kernel command line and rest does not need to be. Can someone clarify this. I remember doing some tests to confirm everything but unfortunately I have lost all the code for that.