All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Dave Scott <dave.scott@citrix.com>
Subject: Re: [PATCH] libxl: ocaml: guard x86-specific functions behind an ifdef
Date: Sat, 11 Jan 2014 23:35:24 +0000	[thread overview]
Message-ID: <20140111233524.GA9666@dark.recoil.org> (raw)
In-Reply-To: <52CED1A2.3000708@citrix.com>

On Thu, Jan 09, 2014 at 04:43:14PM +0000, Andrew Cooper wrote:
> On 09/01/14 16:36, Anil Madhavapeddy wrote:
> > The various cpuid functions are not available on ARM, so this
> > makes them raise an OCaml exception.  Omitting the functions
> > completely them results in a link failure in oxenstored due to
> > the missing symbols, so this is preferable to the much bigger
> > patch that would result from adding conditional compilation into
> > the OCaml interfaces.
> >
> > Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
> >
> > ---
> >  tools/ocaml/libs/xc/xenctrl_stubs.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
> > index f5cf0ed..76864cc 100644
> > --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> > +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> > @@ -714,6 +714,7 @@ CAMLprim value stub_xc_domain_cpuid_set(value xch, value domid,
> >  {
> >  	CAMLparam4(xch, domid, input, config);
> >  	CAMLlocal2(array, tmp);
> > +#if defined(__i386__) || defined(__x86_64__)
> >  	int r;
> >  	unsigned int c_input[2];
> >  	char *c_config[4], *out_config[4];
> > @@ -742,17 +743,24 @@ CAMLprim value stub_xc_domain_cpuid_set(value xch, value domid,
> >  			 c_input, (const char **)c_config, out_config);
> >  	if (r < 0)
> >  		failwith_xc(_H(xch));
> > +#else
> > +	failwith_xc(_H(xch));
> 
> You probably want to set xc's last error so failwith_xc() gives an
> exception with a relevant error message.

After discussion with Dave Scott, we thought it best to just raise a
normal Failure exception rather than the libxc ones.  The functions aren't
used by any of the libraries in-tree at the moment and oxenstored works
for a simple VM start for me with v2 of the patch as well.

-anil

      parent reply	other threads:[~2014-01-11 23:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 16:36 [PATCH] libxl: ocaml: guard x86-specific functions behind an ifdef Anil Madhavapeddy
2014-01-09 16:43 ` Andrew Cooper
2014-01-09 17:04   ` Anil Madhavapeddy
2014-01-11 23:35   ` Anil Madhavapeddy [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=20140111233524.GA9666@dark.recoil.org \
    --to=anil@recoil.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=dave.scott@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.