cloud-hypervisor: Call into the test_vm() routine

test_vm is a dummy VM workload, we use it to test our initial VMM
settings.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-02-22 17:05:02 +01:00
parent 16f2bedbb7
commit a0da3deb5e
4 changed files with 48 additions and 7 deletions

View File

@@ -16,16 +16,16 @@ pub fn test_vm() {
let code = [
0xba, 0xf8, 0x03, /* mov $0x3f8, %dx */
0x00, 0xd8, /* add %bl, %al */
0x04, '0' as u8, /* add $'0', %al */
0xee, /* out %al, (%dx) */
0xb0, '\n' as u8, /* mov $'\n', %al */
0xee, /* out %al, (%dx) */
0xf4, /* hlt */
0x04, b'0', /* add $'0', %al */
0xee, /* out %al, (%dx) */
0xb0, b'\n', /* mov $'\n', %al */
0xee, /* out %al, (%dx) */
0xf4, /* hlt */
];
let mem_size = 0x1000;
let load_addr = GuestAddress(0x1000);
let mem = GuestMemoryMmap::new(&vec![(load_addr, mem_size)]).unwrap();
let mem = GuestMemoryMmap::new(&[(load_addr, mem_size)]).unwrap();
let kvm = Kvm::new().expect("new KVM instance creation failed");
let vm_fd = kvm.create_vm().expect("new VM fd creation failed");