Import patch 3e56de90e3eb8777f8d6c7db57664959407eab49 from xen-api-libs

Originally-by: Vincent Bernardoff <vincent.bernardoff@ocamlpro.com>