The vm startup is complicated and has lots of room for error. In practice using the 'test return value' model has been hard to use because the call order and functions are changing -in the most recent case we're getting back ENOMEM when the error is not ENOMEM at all.
Set up the sys_vmm_setup so that it can call functions which use error(). I've talked to Barret and we're good with this change. Change-Id: I5260814cda2207eb8c698d5b8e9a27c5fb38fbf5 Signed-off-by: Ronald G. Minnich <[email protected]> --- kern/src/syscall.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kern/src/syscall.c b/kern/src/syscall.c index 43ce692..2708745 100644 --- a/kern/src/syscall.c +++ b/kern/src/syscall.c @@ -1469,7 +1469,15 @@ static int sys_pop_ctx(struct proc *p, struct user_context *ctx) static int sys_vmm_setup(struct proc *p, unsigned int nr_guest_pcores, struct vmm_gpcore_init *gpcis, int flags) { - return vmm_struct_init(p, nr_guest_pcores, gpcis, flags); + int ret; + ERRSTACK(1); + if (waserror()) { + poperror(); + return -1; + } + ret = vmm_struct_init(p, nr_guest_pcores, gpcis, flags); + poperror(); + return ret; } static int sys_vmm_poke_guest(struct proc *p, int guest_pcoreid) -- 2.8.0.rc3.226.g39d4020 -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
