diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 90353ec89d..4b8ba5b004 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -401,7 +401,8 @@ CAMLprim value stub_xc_domain_shutdown(value xch_val, value domid, value reason) static value alloc_domaininfo(xc_domaininfo_t * info) { CAMLparam0(); - CAMLlocal5(result, tmp, arch_config, x86_arch_config, emul_list); + CAMLlocal4(result, tmp, arch_config, emul_list); + int tag = -1; int i; result = caml_alloc_tuple(17); @@ -431,6 +432,9 @@ static value alloc_domaininfo(xc_domaininfo_t * info) Store_field(result, 15, tmp); #if defined(__i386__) || defined(__x86_64__) + + tag = 1; /* tag x86 */ + /* * emulation_flags: x86_arch_emulation_flags list; */ @@ -439,16 +443,17 @@ static value alloc_domaininfo(xc_domaininfo_t * info) (info->arch_config.emulation_flags); /* xen_x86_arch_domainconfig */ - x86_arch_config = caml_alloc_tuple(1); - Store_field(x86_arch_config, 0, emul_list); + arch_config = caml_alloc_tuple(1); + Field(arch_config, 0) = emul_list; + +#endif + if (tag < 0) + caml_failwith("Unimplemented architecture in alloc_domaininfo()"); /* arch_config: arch_domainconfig */ - arch_config = caml_alloc_small(1, 1); - - Store_field(arch_config, 0, x86_arch_config); - - Store_field(result, 16, arch_config); -#endif + tmp = caml_alloc_small(1, tag); + Field(tmp, 0) = arch_config; + Field(result, 16) = tmp; CAMLreturn(result); }