From: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
To: Xen Devel <xen-devel@lists.xensource.com>
Cc: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Subject: [PATCH 3/3] Properly adjust fields in ocaml structure to match the C layer.
Date: Tue, 13 Jul 2010 14:51:13 +0100 [thread overview]
Message-ID: <1279029073-28530-4-git-send-email-vincent.hanquez@eu.citrix.com> (raw)
In-Reply-To: <1279029073-28530-1-git-send-email-vincent.hanquez@eu.citrix.com>
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
---
tools/ocaml/libs/xl/xl.ml | 6 +++---
tools/ocaml/libs/xl/xl.mli | 6 +++---
tools/ocaml/libs/xl/xl_stubs.c | 24 ++++++++++++------------
3 files changed, 18 insertions(+), 18 deletions(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-Properly-adjust-fields-in-ocaml-structure-to-match-t.patch --]
[-- Type: text/x-patch; name="0003-Properly-adjust-fields-in-ocaml-structure-to-match-t.patch", Size: 3085 bytes --]
diff --git a/tools/ocaml/libs/xl/xl.ml b/tools/ocaml/libs/xl/xl.ml
index 1e3642f..0e47a85 100644
--- a/tools/ocaml/libs/xl/xl.ml
+++ b/tools/ocaml/libs/xl/xl.ml
@@ -45,15 +45,15 @@ type build_hvm_info =
nx : bool;
viridian : bool;
timeoffset : string;
+ timer_mode : int;
+ hpet : int;
+ vpt_align : int;
}
type build_spec = BuildHVM of build_hvm_info | BuildPV of build_pv_info
type build_info =
{
- timer_mode : int;
- hpet : int;
- vpt_align : int;
max_vcpus : int;
cur_vcpus : int;
max_memkb : int64;
diff --git a/tools/ocaml/libs/xl/xl.mli b/tools/ocaml/libs/xl/xl.mli
index 4193e59..6494296 100644
--- a/tools/ocaml/libs/xl/xl.mli
+++ b/tools/ocaml/libs/xl/xl.mli
@@ -45,15 +45,15 @@ type build_hvm_info =
nx : bool;
viridian : bool;
timeoffset : string;
+ timer_mode : int;
+ hpet : int;
+ vpt_align : int;
}
type build_spec = BuildHVM of build_hvm_info | BuildPV of build_pv_info
type build_info =
{
- timer_mode : int;
- hpet : int;
- vpt_align : int;
max_vcpus : int;
cur_vcpus : int;
max_memkb : int64;
diff --git a/tools/ocaml/libs/xl/xl_stubs.c b/tools/ocaml/libs/xl/xl_stubs.c
index 2d0bb54..4e8d45e 100644
--- a/tools/ocaml/libs/xl/xl_stubs.c
+++ b/tools/ocaml/libs/xl/xl_stubs.c
@@ -114,15 +114,15 @@ static int domain_build_info_val (libxl_domain_build_info *c_val, value v)
CAMLparam1(v);
CAMLlocal1(infopriv);
- c_val->max_vcpus = Int_val(Field(v, 3));
- c_val->cur_vcpus = Int_val(Field(v, 4));
- c_val->max_memkb = Int64_val(Field(v, 5));
- c_val->target_memkb = Int64_val(Field(v, 6));
- c_val->video_memkb = Int64_val(Field(v, 7));
- c_val->shadow_memkb = Int64_val(Field(v, 8));
- c_val->kernel = String_val(Field(v, 9));
- c_val->hvm = Tag_val(Field(v, 10)) == 0;
- infopriv = Field(Field(v, 10), 0);
+ c_val->max_vcpus = Int_val(Field(v, 0));
+ c_val->cur_vcpus = Int_val(Field(v, 1));
+ c_val->max_memkb = Int64_val(Field(v, 2));
+ c_val->target_memkb = Int64_val(Field(v, 3));
+ c_val->video_memkb = Int64_val(Field(v, 4));
+ c_val->shadow_memkb = Int64_val(Field(v, 5));
+ c_val->kernel = String_val(Field(v, 6));
+ c_val->hvm = Tag_val(Field(v, 7)) == 0;
+ infopriv = Field(Field(v, 7), 0);
if (c_val->hvm) {
c_val->u.hvm.pae = Bool_val(Field(infopriv, 0));
c_val->u.hvm.apic = Bool_val(Field(infopriv, 1));
@@ -130,9 +130,9 @@ static int domain_build_info_val (libxl_domain_build_info *c_val, value v)
c_val->u.hvm.nx = Bool_val(Field(infopriv, 3));
c_val->u.hvm.viridian = Bool_val(Field(infopriv, 4));
c_val->u.hvm.timeoffset = String_val(Field(infopriv, 5));
- c_val->u.hvm.timer_mode = Int_val(Field(v, 0));
- c_val->u.hvm.hpet = Int_val(Field(v, 1));
- c_val->u.hvm.vpt_align = Int_val(Field(v, 2));
+ c_val->u.hvm.timer_mode = Int_val(Field(infopriv, 6));
+ c_val->u.hvm.hpet = Int_val(Field(infopriv, 7));
+ c_val->u.hvm.vpt_align = Int_val(Field(infopriv, 8));
} else {
c_val->u.pv.slack_memkb = Int64_val(Field(infopriv, 0));
c_val->u.pv.cmdline = String_val(Field(infopriv, 1));
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
prev parent reply other threads:[~2010-07-13 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 13:51 [PATCH 0/3] update for xl bindings Vincent Hanquez
2010-07-13 13:51 ` [PATCH 1/3] register the ocaml exception so it can be used at the C level Vincent Hanquez
2010-07-13 13:51 ` [PATCH 2/3] add a simple logger to the ocaml bindings Vincent Hanquez
2010-07-13 13:51 ` Vincent Hanquez [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1279029073-28530-4-git-send-email-vincent.hanquez@eu.citrix.com \
--to=vincent.hanquez@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).