xc_vcpu_getcontext() may fail to retrieve the vcpu context. Rather than
ignoring the return value, check it and throw an error if needed.
Signed-off-by: Julien Grall <jgrall@amazon.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
vcpu_guest_context_any_t ctxt;
ret = xc_vcpu_getcontext(_H(xch), _D(domid), Int_val(cpu), &ctxt);
+ if ( ret < 0 )
+ failwith_xc(_H(xch));
context = caml_alloc_string(sizeof(ctxt));
memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));