|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.10] tools/ocaml: Extend domain_create() to take arch_domainconfig
commit 48811d481cedd5838a2d0ba8dfa149133888c84b
Author: Jon Ludlam <jonathan.ludlam@xxxxxxxxxx>
AuthorDate: Thu Jan 11 17:47:59 2018 +0000
Commit: Roger Pau Monne <roger.pau@xxxxxxxxxx>
CommitDate: Thu Jan 11 17:51:18 2018 +0000
tools/ocaml: Extend domain_create() to take arch_domainconfig
No longer passing NULL into xc_domain_create() allows for the creation
of PVH guests.
Signed-off-by: Jon Ludlam <jonathan.ludlam@xxxxxxxxxx>
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
tools/ocaml/libs/xc/xenctrl.ml | 2 +-
tools/ocaml/libs/xc/xenctrl.mli | 2 +-
tools/ocaml/libs/xc/xenctrl_stubs.c | 22 ++++++++++++++++++++--
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index d549068d60..9116aa222c 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -143,7 +143,7 @@ let with_intf f =
interface_close xc;
r
-external _domain_create: handle -> int32 -> domain_create_flag list -> int
array -> domid
+external _domain_create: handle -> int32 -> domain_create_flag list -> int
array -> arch_domainconfig -> domid
= "stub_xc_domain_create"
let int_array_of_uuid_string s =
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index 08f1fd26ae..54c099c88f 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -102,7 +102,7 @@ external sizeof_xen_pfn : unit -> int =
"stub_sizeof_xen_pfn"
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"
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c
b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 124aa34fe8..0b5a2361c0 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -144,7 +144,8 @@ static int domain_create_flag_table[] = {
};
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);
@@ -155,6 +156,7 @@ CAMLprim value stub_xc_domain_create(value xch, value
ssidref,
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");
@@ -168,8 +170,24 @@ CAMLprim value stub_xc_domain_create(value xch, value
ssidref,
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)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |