From: Andrew Cooper Date: Fri, 16 Mar 2018 13:32:04 +0000 (+0000) Subject: tools/ocaml: Drop domain_create_flag_table[] X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3689 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cf4fa365c78b4875e12c8964aa075be43b359b13;p=xen.git tools/ocaml: Drop domain_create_flag_table[] This is a logarithm in disguise. Update the logic to match how x86_arch_emulation_flags works in c/s 9d683b5e37 and b38d96f596. Signed-off-by: Andrew Cooper Acked-by: Christian Lindig --- diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index d4309ad97e..534c7a4320 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -97,11 +97,6 @@ CAMLprim value stub_xc_interface_close(value xch) CAMLreturn(Val_unit); } -static int domain_create_flag_table[] = { - XEN_DOMCTL_CDF_hvm_guest, - XEN_DOMCTL_CDF_hap, -}; - CAMLprim value stub_xc_domain_create(value xch, value ssidref, value flags, value handle, value domconfig) @@ -124,10 +119,8 @@ CAMLprim value stub_xc_domain_create(value xch, value ssidref, h[i] = Int_val(Field(handle, i)) & 0xff; } - for (l = flags; l != Val_none; l = Field(l, 1)) { - int v = Int_val(Field(l, 0)); - c_flags |= domain_create_flag_table[v]; - } + for (l = flags; l != Val_none; l = Field(l, 1)) + c_flags |= 1u << Int_val(Field(l, 0)); switch(Tag_val(domconfig)) { case 0: /* ARM - nothing to do */