}
}
-static struct kvm_vm *create_vm(enum vm_guest_mode mode, uint32_t vcpuid,
+static struct kvm_vm *create_vm(enum vm_guest_mode mode, struct kvm_vcpu **vcpu,
uint64_t extra_mem_pages, void *guest_code)
{
struct kvm_vm *vm;
vm = __vm_create(mode, DEFAULT_GUEST_PHY_PAGES + extra_pg_pages);
log_mode_create_vm_done(vm);
- vm_vcpu_add(vm, vcpuid, guest_code);
+ *vcpu = vm_vcpu_add(vm, 0, guest_code);
return vm;
}
* (e.g., 64K page size guest will need even less memory for
* page tables).
*/
- vm = create_vm(mode, 0,
- 2ul << (DIRTY_MEM_BITS - PAGE_SHIFT_4K),
- guest_code);
- vcpu = vcpu_get(vm, 0);
+ vm = create_vm(mode, &vcpu,
+ 2ul << (DIRTY_MEM_BITS - PAGE_SHIFT_4K), guest_code);
guest_page_size = vm_get_page_size(vm);
/*