external interface_open : unit -> handle = "stub_xc_interface_open"
external interface_close : handle -> unit = "stub_xc_interface_close"
val with_intf : (handle -> 'a) -> 'a
-val domain_create : handle -> int32 -> domain_create_flag list -> string -> domid
+val domain_create : handle -> int32 -> domain_create_flag list -> string -> arch_domainconfig -> domid
val domain_sethandle : handle -> domid -> string -> unit
external domain_max_vcpus : handle -> domid -> int -> unit
= "stub_xc_domain_max_vcpus"
};
CAMLprim value stub_xc_domain_create(value xch, value ssidref,
- value flags, value handle)
+ value flags, value handle,
+ value domconfig)
{
CAMLparam4(xch, ssidref, flags, handle);
uint32_t c_ssidref = Int32_val(ssidref);
unsigned int c_flags = 0;
value l;
+ xc_domain_configuration_t config = {};
if (Wosize_val(handle) != 16)
caml_invalid_argument("Handle not a 16-integer array");
c_flags |= domain_create_flag_table[v];
}
+ switch(Tag_val(domconfig)) {
+ case 0: /* ARM - nothing to do */
+ caml_failwith("Unhandled: ARM");
+ break;
+
+ case 1: /* X86 - emulation flags in the block */
+ for (l = Field(Field(domconfig, 0), 0);
+ l != Val_none;
+ l = Field(l, 1))
+ config.emulation_flags |= 1u << Int_val(Field(l, 0));
+ break;
+
+ default:
+ caml_failwith("Unhandled domconfig type");
+ }
+
caml_enter_blocking_section();
- result = xc_domain_create(_H(xch), c_ssidref, h, c_flags, &domid, NULL);
+ result = xc_domain_create(_H(xch), c_ssidref, h, c_flags, &domid, &config);
caml_leave_blocking_section();
if (result < 0)