oxenstored: refactor putting response on wire
authorJonathan Davies <jonathan.davies@citrix.com>
Thu, 17 Mar 2016 17:51:09 +0000 (17:51 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 24 Mar 2016 14:24:57 +0000 (14:24 +0000)
commita2c5046db9cdb80454dd545b6b907294d8f2f98e
treee5ab4ee882efc149849cde200c36f45f0b6b01d3
parent0fa4c7f25dd0756fcc96de0824deb7763a7fa739
oxenstored: refactor putting response on wire

Previously, the functions reply_{ack,data,data_or_ack} and input_handle_error
put the response on the wire by invoking Connection.send_{ack,reply,error}.

Instead, these functions now return a value indicating what needs to be put on
the wire, and that action is done by a send_response function called
afterwards.

This refactoring gives us a chance to store the value of the response, useful
for replaying transactions.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Reviewed-by: Euan Harris <euan.harris@citrix.com>
Acked-by: David Scott <dave@recoil.org>
tools/ocaml/xenstored/Makefile
tools/ocaml/xenstored/packet.ml [new file with mode: 0644]
tools/ocaml/xenstored/process.ml