From: "Luis R. Rodriguez" Subject: Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets Date: Wed, 30 Apr 2014 19:35:54 +0200 Message-ID: <20140430173554.GG11838@wotan.suse.de> References: <1398820328-15132-1-git-send-email-mcgrof@do-not-panic.com> <1398820328-15132-6-git-send-email-mcgrof@do-not-panic.com> <89279346-3C56-40DC-9CAC-52536DA06695@recoil.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7515310873087060902==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WfYQG-0001eL-Dq for xen-devel@lists.xenproject.org; Wed, 30 Apr 2014 17:35:56 +0000 In-Reply-To: <89279346-3C56-40DC-9CAC-52536DA06695@recoil.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anil Madhavapeddy Cc: David Scott , Stefano Stabellini , Ian Jackson , "Luis R. Rodriguez" , Vincent Hanquez , xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org --===============7515310873087060902== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2JFBq9zoW8cOFH7v" Content-Disposition: inline --2JFBq9zoW8cOFH7v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 30, 2014 at 10:27:43AM +0100, Anil Madhavapeddy wrote: > On 30 Apr 2014, at 02:11, Luis R. Rodriguez wro= te: >=20 > > From: "Luis R. Rodriguez" > >=20 > > This adds systemd socket activation support for the Ocaml xenstored. > > Ocaml lacks systemd library support so we provide our own C helpers > > as is done with other functionality lacking on Ocaml. > >=20 > >=20 > The definition of sd_active_socket_required (unit ->int) below doesn't > match the C stub: >=20 > > + > > +external sd_listen_fds: string -> Unix.file_descr =3D "ocaml_sd_listen= _fds" > > +external sd_active_socket_required: unit -> int =3D "ocaml_sd_active_s= ocket_required" >=20 > > + > > +CAMLprim value ocaml_sd_active_socket_required(void) > > +{ > > + CAMLparam0(); > > + CAMLlocal1(ret); > > + > > + ret =3D Val_int(0); > > + > > + CAMLreturn(ret); > > +} > > +#endif >=20 > That should be: >=20 > CAMLprim value ocaml_sd_active_socket_required(value u) > { > CAMLparam1(u); > CAMLlocal1(ret); > ret =3D Val_int(0); > CAMLreturn(ret); > } Do we have to require an argument though? > (Since the function isn't doing any heap allocation, it's actually > just safe to compress it to "return (Val_int(0))", but it's probably > better to keep it like this to avoid any surprises). >=20 > As Dave notes, returning Val_true and setting the OCaml signature to > bool would be a clearer interface. OK thanks for the review! Let me know what you think of the other changes I sent in reply to Dave. Luis --2JFBq9zoW8cOFH7v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iQIcBAEBAgAGBQJTYTR6AAoJEPep4JnvMe6zYKkQAJjODWMgpvABTlXqqm4mESfa lF/Tr4AXX/tESEPrwmo+XxElnQXrsVpm8xLu+ZCHrb16RaeRuQ+njEt3Tb4sQKNn D8wMekpgO5AmYE8953RToFin3X59JSHnFHUfNC81e9NYdFkdUQbjMxj/Gcg2FY2M UMV0o0RqTi5AgDPRZA9NskP4KdpBZbtSQ5vvF56VGPuFDbQ/gRQch5UA6w5WEkBA BEcEC5uDX1uZRKuVv9s+TTOfiT4axPOE9LvlFYFHkz9132NgwvozyAxxRx8mvIY6 sZqeRxu4LNBmUnCeryKQvL7hcBzRjeguB+7LnpuOj6vAXvRbH5xBSXXq7soTia5z +/Kh388OV4tw7Mp8W7TkLg4aeTAiXTxhoZMiAiuGvFEPVE4VreUBxL4eGIv4ItX9 alX4OOurd5mewxFIQGSf/sN3aPDnFSdLfMOhYqnacTxDm5n5XvTkTyAugHPAV/we EXR7oF6PcwLfINEDbzFVw1dFD33UKZzPbindPlYC4ONwIJEezc/6384cD6b0wn1W vKxnFIAssp8ihNbM+Besi+I77NDAxo3UgKCFq3ySW2/jzbFmXqugmrgHzjcizFbE bPQSQB5SeH/Tcu0xK7JSo1eeXdy204AG8mezbXMcuzXFscgfRvi9V81vn+VagfDJ bPWZUF/pW6Bu9fm5qjOG =lD7/ -----END PGP SIGNATURE----- --2JFBq9zoW8cOFH7v-- --===============7515310873087060902== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============7515310873087060902==--