Debian Codegraph @

tools/xenstored/lu.h

raw
1 /* SPDX-License-Identifier: MIT */
2
3 /*
4 * Live Update interfaces for Xen Store Daemon.
5 * Copyright (C) 2022 Juergen Gross, SUSE LLC
6 */
7
8 #ifndef NO_LIVE_UPDATE
9 struct live_update {
10 /* For verification the correct connection is acting. */
11 struct connection *conn;
12
13 /* Pointer to the command used to request LU */
14 struct buffered_data *in;
15
16 #ifdef __MINIOS__
17 void *kernel;
18 unsigned int kernel_size;
19 unsigned int kernel_off;
20
21 #endif
22
23 char *filename;
24 char *cmdline;
25
26 /* Start parameters. */
27 bool force;
28 unsigned int timeout;
29 time_t started_at;
30 };
31
32 extern struct live_update *lu_status;
33
34 struct connection *lu_get_connection(void);
35 bool lu_is_pending(void);
36 void lu_read_state(void);
37
38 /* Write the "OK" response for the live-update command */
39 unsigned int lu_write_response(FILE *fp);
40
41 int do_control_lu(const void *ctx, struct connection *conn, const char **vec,
42 int num);
43
44 /* Live update private interfaces. */
45 char *lu_exec(const void *ctx, int argc, char **argv);
46 const char *lu_arch(const void *ctx, struct connection *conn, const char **vec,
47 int num);
48 const char *lu_begin(struct connection *conn);
49 #else
50 static inline struct connection *lu_get_connection(void)
51 {
52 return NULL;
53 }
54
55 static inline unsigned int lu_write_response(FILE *fp)
56 {
57 return 0;
58 }
59
60 static inline bool lu_is_pending(void)
61 {
62 return false;
63 }
64 #endif