[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tools/ocaml: Drop domain_create_flag_table[]



commit cf4fa365c78b4875e12c8964aa075be43b359b13
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Mar 16 13:32:04 2018 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Jul 4 16:25:01 2018 +0100

    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 <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

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 */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.