1 /* SPDX-License-Identifier: MIT */
3 * Details of the "wire" protocol between Xen Store Daemon and client
4 * library or guest kernel.
6 * Copyright (C) 2005 Rusty Russell IBM Corporation
15 #define XS_DEBUG XS_CONTROL
32 XS_IS_DOMAIN_INTRODUCED
,
35 /* XS_RESTRICT has been removed */
36 XS_RESET_WATCHES
= XS_SET_TARGET
+ 2,
39 XS_TYPE_COUNT
, /* Number of valid types. */
41 XS_INVALID
= 0xffff /* Guaranteed to remain an invalid type */
44 #define XS_WRITE_NONE "NONE"
45 #define XS_WRITE_CREATE "CREATE"
46 #define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
48 /* We hand errors as strings, for portability. */
52 const char *errstring
;
55 #define XSD_ERROR(x) { x, #x }
56 /* LINTED: static unused */
57 static const struct xsd_errors xsd_errors
[]
59 __attribute__((unused
))
62 /* /!\ New errors should be added at the end of the array. */
84 uint32_t type
; /* XS_??? */
85 uint32_t req_id
;/* Request identifier, echoed in daemon's response. */
86 uint32_t tx_id
; /* Transaction id (0 if not related to a transaction). */
87 uint32_t len
; /* Length of data following this. */
89 /* Generally followed by nul-terminated string(s). */
99 * `incontents 150 xenstore_struct XenStore wire protocol.
101 * Inter-domain shared memory communications. */
102 #define XENSTORE_RING_SIZE 1024
103 typedef uint32_t XENSTORE_RING_IDX
;
104 #define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
105 struct xenstore_domain_interface
{
106 char req
[XENSTORE_RING_SIZE
]; /* Requests to xenstore daemon. */
107 char rsp
[XENSTORE_RING_SIZE
]; /* Replies and async watch events. */
108 XENSTORE_RING_IDX req_cons
, req_prod
;
109 XENSTORE_RING_IDX rsp_cons
, rsp_prod
;
110 uint32_t server_features
; /* Bitmap of features supported by the server */
115 /* Violating this is very bad. See docs/misc/xenstore.txt. */
116 #define XENSTORE_PAYLOAD_MAX 4096
118 /* Violating these just gets you an error back */
119 #define XENSTORE_ABS_PATH_MAX 3072
120 #define XENSTORE_REL_PATH_MAX 2048
122 /* The ability to reconnect a ring */
123 #define XENSTORE_SERVER_FEATURE_RECONNECTION 1
124 /* The presence of the "error" field in the ring page */
125 #define XENSTORE_SERVER_FEATURE_ERROR 2
127 /* Valid values for the connection field */
128 #define XENSTORE_CONNECTED 0 /* the steady-state */
129 #define XENSTORE_RECONNECT 1 /* reconnect in progress */
131 /* Valid values for the error field */
132 #define XENSTORE_ERROR_NONE 0 /* No error */
133 #define XENSTORE_ERROR_COMM 1 /* Communication problem */
134 #define XENSTORE_ERROR_RINGIDX 2 /* Invalid ring index */
135 #define XENSTORE_ERROR_PROTO 3 /* Protocol violation (payload too long) */
137 #endif /* _XS_WIRE_H */
142 * c-file-style: "BSD"
145 * indent-tabs-mode: nil