Move VM ID from `struct mm_ptable` to `struct vm`.
The ID is a property of the VM and when it is needed along side the
ptable, both pieces of information are available.
Change-Id: I4c6165b931a4acd8128a21a9cc92880a1b47ceae
diff --git a/src/vm.c b/src/vm.c
index 963531a..d03aba8 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -10,6 +10,7 @@
memset(vm, 0, sizeof(*vm));
+ vm->id = id;
vm->vcpu_count = vcpu_count;
vm->rpc.state = rpc_state_idle;
@@ -18,7 +19,7 @@
vcpu_init(vm->vcpus + i, vm);
}
- return mm_ptable_init(&vm->ptable, id, 0);
+ return mm_ptable_init(&vm->ptable, 0);
}
/* TODO: Shall we use index or id here? */
@@ -34,5 +35,5 @@
void vm_set_current(struct vm *vm)
{
arch_cpu_update(vm == &primary_vm);
- arch_mm_set_vm(vm->ptable.id, vm->ptable.table);
+ arch_mm_set_vm(vm->id, vm->ptable.table);
}