Say I have a x86 machine. It's easy to create a x86 VM through Linux KVM API.
See: vm_init() in kvm-host:
if ((v->kvm_fd = open("/dev/kvm", O_RDWR)) < 0)
return throw_err("Failed to open /dev/kvm");
if ((v->vm_fd = ioctl(v->kvm_fd, KVM_CREATE_VM, 0)) < 0)
return throw_err("Failed to create vm");
if (ioctl(v->vm_fd, KVM_SET_TSS_ADDR, 0xffffd000) < 0)
return throw_err("Failed to set TSS addr");
...
if ((v->vcpu_fd = ioctl(v->vm_fd, KVM_CREATE_VCPU, 0)) < 0)
return throw_err("Failed to create vcpu");
In this project, it's easy to create a x86 VM on a x86 machine.
My question is, however, what if i want that VM to be a ARM architecture?
I believe that is applicable because we have qemu-system-arm, and what I try to achieve is exactly what it does.