root / qapi-schema-guest.json @ db80358a
History | View | Annotate | Download (5.1 kB)
1 | e3d4d252 | Michael Roth | # *-*- Mode: Python -*-* |
---|---|---|---|
2 | e3d4d252 | Michael Roth | |
3 | e3d4d252 | Michael Roth | ## |
4 | e3d4d252 | Michael Roth | # @guest-sync: |
5 | e3d4d252 | Michael Roth | #
|
6 | e3d4d252 | Michael Roth | # Echo back a unique integer value |
7 | e3d4d252 | Michael Roth | #
|
8 | e3d4d252 | Michael Roth | # This is used by clients talking to the guest agent over the |
9 | e3d4d252 | Michael Roth | # wire to ensure the stream is in sync and doesn't contain stale |
10 | e3d4d252 | Michael Roth | # data from previous client. All guest agent responses should be |
11 | e3d4d252 | Michael Roth | # ignored until the provided unique integer value is returned, |
12 | e3d4d252 | Michael Roth | # and it is up to the client to handle stale whole or |
13 | e3d4d252 | Michael Roth | # partially-delivered JSON text in such a way that this response |
14 | e3d4d252 | Michael Roth | # can be obtained. |
15 | e3d4d252 | Michael Roth | #
|
16 | e3d4d252 | Michael Roth | # Such clients should also preceed this command |
17 | e3d4d252 | Michael Roth | # with a 0xFF byte to make such the guest agent flushes any |
18 | e3d4d252 | Michael Roth | # partially read JSON data from a previous session. |
19 | e3d4d252 | Michael Roth | #
|
20 | e3d4d252 | Michael Roth | # @id: randomly generated 64-bit integer |
21 | e3d4d252 | Michael Roth | #
|
22 | e3d4d252 | Michael Roth | # Returns: The unique integer id passed in by the client |
23 | e3d4d252 | Michael Roth | #
|
24 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
25 | e3d4d252 | Michael Roth | ## |
26 | e3d4d252 | Michael Roth | { 'command': 'guest-sync' |
27 | e3d4d252 | Michael Roth | 'data': { 'id': 'int' }, |
28 | e3d4d252 | Michael Roth | 'returns': 'int' } |
29 | e3d4d252 | Michael Roth | |
30 | e3d4d252 | Michael Roth | ## |
31 | e3d4d252 | Michael Roth | # @guest-ping: |
32 | e3d4d252 | Michael Roth | #
|
33 | e3d4d252 | Michael Roth | # Ping the guest agent, a non-error return implies success |
34 | e3d4d252 | Michael Roth | #
|
35 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
36 | e3d4d252 | Michael Roth | ## |
37 | e3d4d252 | Michael Roth | { 'command': 'guest-ping' } |
38 | e3d4d252 | Michael Roth | |
39 | e3d4d252 | Michael Roth | ## |
40 | e3d4d252 | Michael Roth | # @guest-info: |
41 | e3d4d252 | Michael Roth | #
|
42 | e3d4d252 | Michael Roth | # Get some information about the guest agent. |
43 | e3d4d252 | Michael Roth | #
|
44 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
45 | e3d4d252 | Michael Roth | ## |
46 | e3d4d252 | Michael Roth | { 'type': 'GuestAgentInfo', 'data': {'version': 'str'} } |
47 | e3d4d252 | Michael Roth | { 'command': 'guest-info', |
48 | e3d4d252 | Michael Roth | 'returns': 'GuestAgentInfo' } |
49 | e3d4d252 | Michael Roth | |
50 | e3d4d252 | Michael Roth | ## |
51 | e3d4d252 | Michael Roth | # @guest-shutdown: |
52 | e3d4d252 | Michael Roth | #
|
53 | e3d4d252 | Michael Roth | # Initiate guest-activated shutdown. Note: this is an asynchronous |
54 | e3d4d252 | Michael Roth | # shutdown request, with no guaruntee of successful shutdown. Errors |
55 | e3d4d252 | Michael Roth | # will be logged to guest's syslog. |
56 | e3d4d252 | Michael Roth | #
|
57 | e3d4d252 | Michael Roth | # @mode: #optional "halt", "powerdown" (default), or "reboot" |
58 | e3d4d252 | Michael Roth | #
|
59 | e3d4d252 | Michael Roth | # Returns: Nothing on success |
60 | e3d4d252 | Michael Roth | #
|
61 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
62 | e3d4d252 | Michael Roth | ## |
63 | e3d4d252 | Michael Roth | { 'command': 'guest-shutdown', 'data': { '*mode': 'str' } } |
64 | e3d4d252 | Michael Roth | |
65 | e3d4d252 | Michael Roth | ## |
66 | e3d4d252 | Michael Roth | # @guest-file-open: |
67 | e3d4d252 | Michael Roth | #
|
68 | e3d4d252 | Michael Roth | # Open a file in the guest and retrieve a file handle for it |
69 | e3d4d252 | Michael Roth | #
|
70 | e3d4d252 | Michael Roth | # @filepath: Full path to the file in the guest to open. |
71 | e3d4d252 | Michael Roth | #
|
72 | e3d4d252 | Michael Roth | # @mode: #optional open mode, as per fopen(), "r" is the default. |
73 | e3d4d252 | Michael Roth | #
|
74 | e3d4d252 | Michael Roth | # Returns: Guest file handle on success. |
75 | e3d4d252 | Michael Roth | #
|
76 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
77 | e3d4d252 | Michael Roth | ## |
78 | e3d4d252 | Michael Roth | { 'command': 'guest-file-open', |
79 | e3d4d252 | Michael Roth | 'data': { 'path': 'str', '*mode': 'str' }, |
80 | e3d4d252 | Michael Roth | 'returns': 'int' } |
81 | e3d4d252 | Michael Roth | |
82 | e3d4d252 | Michael Roth | ## |
83 | e3d4d252 | Michael Roth | # @guest-file-close: |
84 | e3d4d252 | Michael Roth | #
|
85 | e3d4d252 | Michael Roth | # Close an open file in the guest |
86 | e3d4d252 | Michael Roth | #
|
87 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
88 | e3d4d252 | Michael Roth | #
|
89 | e3d4d252 | Michael Roth | # Returns: Nothing on success. |
90 | e3d4d252 | Michael Roth | #
|
91 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
92 | e3d4d252 | Michael Roth | ## |
93 | e3d4d252 | Michael Roth | { 'command': 'guest-file-close', |
94 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int' } } |
95 | e3d4d252 | Michael Roth | |
96 | e3d4d252 | Michael Roth | ## |
97 | e3d4d252 | Michael Roth | # @guest-file-read: |
98 | e3d4d252 | Michael Roth | #
|
99 | e3d4d252 | Michael Roth | # Read from an open file in the guest. Data will be base64-encoded |
100 | e3d4d252 | Michael Roth | #
|
101 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
102 | e3d4d252 | Michael Roth | #
|
103 | e3d4d252 | Michael Roth | # @count: #optional maximum number of bytes to read (default is 4KB) |
104 | e3d4d252 | Michael Roth | #
|
105 | e3d4d252 | Michael Roth | # Returns: GuestFileRead on success. Note: count is number of bytes read |
106 | e3d4d252 | Michael Roth | # *before* base64 encoding bytes read. |
107 | e3d4d252 | Michael Roth | #
|
108 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
109 | e3d4d252 | Michael Roth | ## |
110 | e3d4d252 | Michael Roth | { 'type': 'GuestFileRead', |
111 | e3d4d252 | Michael Roth | 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } } |
112 | e3d4d252 | Michael Roth | |
113 | e3d4d252 | Michael Roth | { 'command': 'guest-file-read', |
114 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int', '*count': 'int' }, |
115 | e3d4d252 | Michael Roth | 'returns': 'GuestFileRead' } |
116 | e3d4d252 | Michael Roth | |
117 | e3d4d252 | Michael Roth | ## |
118 | e3d4d252 | Michael Roth | # @guest-file-write: |
119 | e3d4d252 | Michael Roth | #
|
120 | e3d4d252 | Michael Roth | # Write to an open file in the guest. |
121 | e3d4d252 | Michael Roth | #
|
122 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
123 | e3d4d252 | Michael Roth | #
|
124 | e3d4d252 | Michael Roth | # @buf-b64: base64-encoded string representing data to be written |
125 | e3d4d252 | Michael Roth | #
|
126 | e3d4d252 | Michael Roth | # @count: #optional bytes to write (actual bytes, after base64-decode), |
127 | e3d4d252 | Michael Roth | # default is all content in buf-b64 buffer after base64 decoding |
128 | e3d4d252 | Michael Roth | #
|
129 | e3d4d252 | Michael Roth | # Returns: GuestFileWrite on success. Note: count is the number of bytes |
130 | e3d4d252 | Michael Roth | # base64-decoded bytes written |
131 | e3d4d252 | Michael Roth | #
|
132 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
133 | e3d4d252 | Michael Roth | ## |
134 | e3d4d252 | Michael Roth | { 'type': 'GuestFileWrite', |
135 | e3d4d252 | Michael Roth | 'data': { 'count': 'int', 'eof': 'bool' } } |
136 | e3d4d252 | Michael Roth | { 'command': 'guest-file-write', |
137 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' }, |
138 | e3d4d252 | Michael Roth | 'returns': 'GuestFileWrite' } |
139 | e3d4d252 | Michael Roth | |
140 | e3d4d252 | Michael Roth | ## |
141 | e3d4d252 | Michael Roth | # @guest-file-seek: |
142 | e3d4d252 | Michael Roth | #
|
143 | e3d4d252 | Michael Roth | # Seek to a position in the file, as with fseek(), and return the |
144 | e3d4d252 | Michael Roth | # current file position afterward. Also encapsulates ftell()'s |
145 | e3d4d252 | Michael Roth | # functionality, just Set offset=0, whence=SEEK_CUR. |
146 | e3d4d252 | Michael Roth | #
|
147 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
148 | e3d4d252 | Michael Roth | #
|
149 | e3d4d252 | Michael Roth | # @offset: bytes to skip over in the file stream |
150 | e3d4d252 | Michael Roth | #
|
151 | e3d4d252 | Michael Roth | # @whence: SEEK_SET, SEEK_CUR, or SEEK_END, as with fseek() |
152 | e3d4d252 | Michael Roth | #
|
153 | e3d4d252 | Michael Roth | # Returns: GuestFileSeek on success. |
154 | e3d4d252 | Michael Roth | #
|
155 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
156 | e3d4d252 | Michael Roth | ## |
157 | e3d4d252 | Michael Roth | { 'type': 'GuestFileSeek', |
158 | e3d4d252 | Michael Roth | 'data': { 'position': 'int', 'eof': 'bool' } } |
159 | e3d4d252 | Michael Roth | |
160 | e3d4d252 | Michael Roth | { 'command': 'guest-file-seek', |
161 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int', 'offset': 'int', 'whence': 'int' }, |
162 | e3d4d252 | Michael Roth | 'returns': 'GuestFileSeek' } |
163 | e3d4d252 | Michael Roth | |
164 | e3d4d252 | Michael Roth | ## |
165 | e3d4d252 | Michael Roth | # @guest-file-flush: |
166 | e3d4d252 | Michael Roth | #
|
167 | e3d4d252 | Michael Roth | # Write file changes bufferred in userspace to disk/kernel buffers |
168 | e3d4d252 | Michael Roth | #
|
169 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
170 | e3d4d252 | Michael Roth | #
|
171 | e3d4d252 | Michael Roth | # Returns: Nothing on success. |
172 | e3d4d252 | Michael Roth | #
|
173 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
174 | e3d4d252 | Michael Roth | ## |
175 | e3d4d252 | Michael Roth | { 'command': 'guest-file-flush', |
176 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int' } } |
177 | e3d4d252 | Michael Roth | |
178 | e3d4d252 | Michael Roth | ## |
179 | e3d4d252 | Michael Roth | # @guest-fsfreeze-status: |
180 | e3d4d252 | Michael Roth | #
|
181 | e3d4d252 | Michael Roth | # Get guest fsfreeze state. error state indicates failure to thaw 1 or more |
182 | e3d4d252 | Michael Roth | # previously frozen filesystems, or failure to open a previously cached |
183 | e3d4d252 | Michael Roth | # filesytem (filesystem unmounted/directory changes, etc). |
184 | e3d4d252 | Michael Roth | #
|
185 | e3d4d252 | Michael Roth | # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below) |
186 | e3d4d252 | Michael Roth | #
|
187 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
188 | e3d4d252 | Michael Roth | ## |
189 | e3d4d252 | Michael Roth | { 'enum': 'GuestFsfreezeStatus', |
190 | e3d4d252 | Michael Roth | 'data': [ 'thawed', 'frozen', 'error' ] } |
191 | e3d4d252 | Michael Roth | { 'command': 'guest-fsfreeze-status', |
192 | e3d4d252 | Michael Roth | 'returns': 'GuestFsfreezeStatus' } |
193 | e3d4d252 | Michael Roth | |
194 | e3d4d252 | Michael Roth | ## |
195 | e3d4d252 | Michael Roth | # @guest-fsfreeze-freeze: |
196 | e3d4d252 | Michael Roth | #
|
197 | e3d4d252 | Michael Roth | # Sync and freeze all non-network guest filesystems |
198 | e3d4d252 | Michael Roth | #
|
199 | e3d4d252 | Michael Roth | # Returns: Number of file systems frozen on success |
200 | e3d4d252 | Michael Roth | #
|
201 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
202 | e3d4d252 | Michael Roth | ## |
203 | e3d4d252 | Michael Roth | { 'command': 'guest-fsfreeze-freeze', |
204 | e3d4d252 | Michael Roth | 'returns': 'int' } |
205 | e3d4d252 | Michael Roth | |
206 | e3d4d252 | Michael Roth | ## |
207 | e3d4d252 | Michael Roth | # @guest-fsfreeze-thaw: |
208 | e3d4d252 | Michael Roth | #
|
209 | e3d4d252 | Michael Roth | # Unfreeze frozen guest fileystems |
210 | e3d4d252 | Michael Roth | #
|
211 | e3d4d252 | Michael Roth | # Returns: Number of file systems thawed |
212 | e3d4d252 | Michael Roth | # If error, -1 (unknown error) or -errno |
213 | e3d4d252 | Michael Roth | #
|
214 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
215 | e3d4d252 | Michael Roth | ## |
216 | e3d4d252 | Michael Roth | { 'command': 'guest-fsfreeze-thaw', |
217 | e3d4d252 | Michael Roth | 'returns': 'int' } |