Store all VMs together.

In preparation for the primary VM becoming less special, particularly in
the context of IPC where any VM will be able to talk to any other VM.
The primary VM takes ID 0 and the secondary VMs take the IDs from 1.

`hf_vm_get_count()` now returns the total number of VMs including the
primary.

`hf_rpc_request()` block reflexive calls as there is no good reason for
them and the error has the chance of catching bugs in the calling VM.

Change-Id: Ic95ef0ab8b967bbbd3232c207c53074cff8e138d
diff --git a/inc/hf/api.h b/inc/hf/api.h
index 934404d..d598ffc 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -3,21 +3,16 @@
 #include "hf/cpu.h"
 #include "hf/vm.h"
 
-/* TODO: Can we hide these? */
-extern struct vm secondary_vm[MAX_VMS];
-extern uint32_t secondary_vm_count;
-extern struct vm primary_vm;
-
 struct vcpu *api_switch_to_primary(size_t primary_retval,
 				   enum vcpu_state secondary_state);
 
 int32_t api_vm_get_count(void);
-int32_t api_vcpu_get_count(uint32_t vm_idx);
-int32_t api_vcpu_run(uint32_t vm_idx, uint32_t vcpu_idx, struct vcpu **next);
+int32_t api_vcpu_get_count(uint32_t vm_id);
+int32_t api_vcpu_run(uint32_t vm_id, uint32_t vcpu_idx, struct vcpu **next);
 struct vcpu *api_wait_for_interrupt(void);
 int32_t api_vm_configure(ipaddr_t send, ipaddr_t recv);
 
-int32_t api_rpc_request(uint32_t vm_idx, size_t size);
+int32_t api_rpc_request(uint32_t vm_id, size_t size);
 int32_t api_rpc_read_request(bool block, struct vcpu **next);
 int32_t api_rpc_reply(size_t size, bool ack, struct vcpu **next);
 int32_t api_rpc_ack(void);