xapi-project / xcp-networkd

The XCP networking daemon
Other
14 stars 42 forks source link

network_monitor_thread: use Xmlrpc_client instead of Rpc_client #144

Closed edwintorok closed 6 years ago

edwintorok commented 6 years ago

For compatibility with new rpclib 5.8.0, see failure in https://github.com/xapi-project/xs-opam/pull/291 - the Rpc_client module has been removed from ocaml-rpc

edwintorok commented 6 years ago

Lets wait for a travis build, the long term goal should be to remove this hand rolled http parser, and use http-svr or cohttp.

robhoes commented 6 years ago

This is used for xcp-networkd to do API calls to xapi in network_monitor_thread.ml. There must be a better way. For example use Xmlrpc_client like this:

let xapirpc xml =
  let open Xmlrpc_client in
  XMLRPC_protocol.rpc ~srcstr:"xcp-networkd" ~dststr:"xapi" ~transport:(Unix "/var/xapi/xapi") ~http:(xmlrpc ~version:"1.0" "/") xml
gaborigloi commented 6 years ago

I've squashed the commits

jonludlam commented 6 years ago

Please change the title of the PR

robhoes commented 6 years ago

May I assume that someone has tested this?

gaborigloi commented 6 years ago

There is a BVT in progress.

robhoes commented 6 years ago

A good test for this would be to have a PIF with DHCP configuration, and checking that the PIF.IP field gets set when the DHCP address comes in.

gaborigloi commented 6 years ago

I've tested this by adding a new DHCP network in XenCenter and the correct IP appeared soon afterwards.