direct-io.hg

view xen/include/public/io/xs_wire.h @ 7480:a90d670c98b9

Change the semantics of GetDomainPath so that it always succeeds, regardless of
whether a domain has been introduced to the store. Added a separate message
XS_IS_DOMAIN_INTRODUCED and API for that (xs_is_domain_introduced) to determine
whether the domain has really been introduced. This change means that the
tools can determine the correct domain path earlier in the domain creation
process, which is particularly a factor with live migration, as it allows us
to create the devices earlier in the process, and unpause the new domain before
performing the introduce. Until recently we already had these features, but
the simplification of the interface between xend and xenstored caused breakage.

No longer clear out the domain path when a domain is introduced -- this was a
hack to work around the recent problematic semantics of GetDomainPath.

Do not write the contents of the info block to the store. All the configuration
info is written to the /vm path, and anything else in the info block is either
dealt with explicitly or is ephemeral and has no place in the store.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Sun Oct 23 22:45:15 2005 +0100 (2005-10-23)
parents 2796f432858e
children fc8d01a6dcac
line source
1 /*
2 * Details of the "wire" protocol between Xen Store Daemon and client
3 * library or guest kernel.
4 * Copyright (C) 2005 Rusty Russell IBM Corporation
5 *
6 * This file may be distributed separately from the Linux kernel, or
7 * incorporated into other software packages, subject to the following license:
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this source file (the "Software"), to deal in the Software without
11 * restriction, including without limitation the rights to use, copy, modify,
12 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
13 * and to permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 * IN THE SOFTWARE.
26 */
28 #ifndef _XS_WIRE_H
29 #define _XS_WIRE_H
31 enum xsd_sockmsg_type
32 {
33 XS_DEBUG,
34 XS_DIRECTORY,
35 XS_READ,
36 XS_GET_PERMS,
37 XS_WATCH,
38 XS_UNWATCH,
39 XS_TRANSACTION_START,
40 XS_TRANSACTION_END,
41 XS_INTRODUCE,
42 XS_RELEASE,
43 XS_GET_DOMAIN_PATH,
44 XS_WRITE,
45 XS_MKDIR,
46 XS_RM,
47 XS_SET_PERMS,
48 XS_WATCH_EVENT,
49 XS_ERROR,
50 XS_IS_DOMAIN_INTRODUCED
51 };
53 #define XS_WRITE_NONE "NONE"
54 #define XS_WRITE_CREATE "CREATE"
55 #define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
57 /* We hand errors as strings, for portability. */
58 struct xsd_errors
59 {
60 int errnum;
61 const char *errstring;
62 };
63 #define XSD_ERROR(x) { x, #x }
64 static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
65 XSD_ERROR(EINVAL),
66 XSD_ERROR(EACCES),
67 XSD_ERROR(EEXIST),
68 XSD_ERROR(EISDIR),
69 XSD_ERROR(ENOENT),
70 XSD_ERROR(ENOMEM),
71 XSD_ERROR(ENOSPC),
72 XSD_ERROR(EIO),
73 XSD_ERROR(ENOTEMPTY),
74 XSD_ERROR(ENOSYS),
75 XSD_ERROR(EROFS),
76 XSD_ERROR(EBUSY),
77 XSD_ERROR(EAGAIN),
78 XSD_ERROR(EISCONN),
79 };
81 struct xsd_sockmsg
82 {
83 uint32_t type; /* XS_??? */
84 uint32_t req_id;/* Request identifier, echoed in daemon's response. */
85 uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
86 uint32_t len; /* Length of data following this. */
88 /* Generally followed by nul-terminated string(s). */
89 };
91 enum xs_watch_type
92 {
93 XS_WATCH_PATH = 0,
94 XS_WATCH_TOKEN,
95 };
97 /* Inter-domain shared memory communications. */
98 #define XENSTORE_RING_SIZE 1024
99 typedef uint32_t XENSTORE_RING_IDX;
100 #define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
101 struct xenstore_domain_interface {
102 char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
103 char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
104 XENSTORE_RING_IDX req_cons, req_prod;
105 XENSTORE_RING_IDX rsp_cons, rsp_prod;
106 };
108 #endif /* _XS_WIRE_H */
110 /*
111 * Local variables:
112 * mode: C
113 * c-set-style: "BSD"
114 * c-basic-offset: 4
115 * tab-width: 4
116 * indent-tabs-mode: nil
117 * End:
118 */