1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Details of the "wire" protocol between Xen Store Daemon and client
4 * library or guest kernel.
5 * Copyright (C) 2005 Rusty Russell IBM Corporation
30 XS_IS_DOMAIN_INTRODUCED
,
37 #define XS_WRITE_NONE "NONE"
38 #define XS_WRITE_CREATE "CREATE"
39 #define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
41 /* We hand errors as strings, for portability. */
45 const char *errstring
;
47 #define XSD_ERROR(x) { x, #x }
48 static struct xsd_errors xsd_errors
[] __attribute__((unused
)) = {
67 uint32_t type
; /* XS_??? */
68 uint32_t req_id
;/* Request identifier, echoed in daemon's response. */
69 uint32_t tx_id
; /* Transaction id (0 if not related to a transaction). */
70 uint32_t len
; /* Length of data following this. */
72 /* Generally followed by nul-terminated string(s). */
81 /* Inter-domain shared memory communications. */
82 #define XENSTORE_RING_SIZE 1024
83 typedef uint32_t XENSTORE_RING_IDX
;
84 #define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
85 struct xenstore_domain_interface
{
86 char req
[XENSTORE_RING_SIZE
]; /* Requests to xenstore daemon. */
87 char rsp
[XENSTORE_RING_SIZE
]; /* Replies and async watch events. */
88 XENSTORE_RING_IDX req_cons
, req_prod
;
89 XENSTORE_RING_IDX rsp_cons
, rsp_prod
;
92 /* Violating this is very bad. See docs/misc/xenstore.txt. */
93 #define XENSTORE_PAYLOAD_MAX 4096
95 #endif /* _XS_WIRE_H */