oxenstored: fix ABI breakage introduced in Xen 4.9.0
authorEdwin Török <edvin.torok@citrix.com>
Wed, 15 Jul 2020 15:10:56 +0000 (16:10 +0100)
committerWei Liu <wl@xen.org>
Tue, 21 Jul 2020 12:31:45 +0000 (12:31 +0000)
commita6ed77f1e0334c26e6e216aea45f8674d9284856
treeff2e6203cd336e94983051c3e3edfd26ab7a9acb
parent6d49fbdeab3e687a6818f809ca3d98ac7ced2c8d
oxenstored: fix ABI breakage introduced in Xen 4.9.0

dbc84d2983969bb47d294131ed9e6bbbdc2aec49 (Xen >= 4.9.0) deleted XS_RESTRICT
from oxenstored, which caused all the following opcodes to be shifted by 1:
reset_watches became off-by-one compared to the C version of xenstored.

Looking at the C code the opcode for reset watches needs:
XS_RESET_WATCHES = XS_SET_TARGET + 2

So add the placeholder `Invalid` in the OCaml<->C mapping list.
(Note that the code here doesn't simply convert the OCaml constructor to
 an integer, so we don't need to introduce a dummy constructor).

Igor says that with a suitably patched xenopsd to enable watch reset,
we now see `reset watches` during kdump of a guest in xenstored-access.log.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/libs/xb/op.ml