]>
Commit | Line | Data |
---|---|---|
094a2239 PD |
1 | /* |
2 | * Copyright (c) 2018 Citrix Systems Inc. | |
3 | * | |
4 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | |
5 | * See the COPYING file in the top-level directory. | |
6 | */ | |
7 | ||
8 | #ifndef HW_XEN_BUS_HELPER_H | |
9 | #define HW_XEN_BUS_HELPER_H | |
10 | ||
ba2a92db | 11 | #include "hw/xen/xen_backend_ops.h" |
094a2239 PD |
12 | |
13 | const char *xs_strstate(enum xenbus_state state); | |
14 | ||
ba2a92db PD |
15 | void xs_node_create(struct qemu_xs_handle *h, xs_transaction_t tid, |
16 | const char *node, unsigned int owner, unsigned int domid, | |
17 | unsigned int perms, Error **errp); | |
18 | void xs_node_destroy(struct qemu_xs_handle *h, xs_transaction_t tid, | |
094a2239 PD |
19 | const char *node, Error **errp); |
20 | ||
21 | /* Write to node/key unless node is empty, in which case write to key */ | |
ba2a92db | 22 | void xs_node_vprintf(struct qemu_xs_handle *h, xs_transaction_t tid, |
094a2239 PD |
23 | const char *node, const char *key, Error **errp, |
24 | const char *fmt, va_list ap) | |
9edc6313 | 25 | G_GNUC_PRINTF(6, 0); |
ba2a92db | 26 | void xs_node_printf(struct qemu_xs_handle *h, xs_transaction_t tid, |
094a2239 PD |
27 | const char *node, const char *key, Error **errp, |
28 | const char *fmt, ...) | |
9edc6313 | 29 | G_GNUC_PRINTF(6, 7); |
094a2239 PD |
30 | |
31 | /* Read from node/key unless node is empty, in which case read from key */ | |
ba2a92db | 32 | int xs_node_vscanf(struct qemu_xs_handle *h, xs_transaction_t tid, |
094a2239 | 33 | const char *node, const char *key, Error **errp, |
d62449da DB |
34 | const char *fmt, va_list ap) |
35 | G_GNUC_SCANF(6, 0); | |
ba2a92db | 36 | int xs_node_scanf(struct qemu_xs_handle *h, xs_transaction_t tid, |
094a2239 | 37 | const char *node, const char *key, Error **errp, |
d62449da DB |
38 | const char *fmt, ...) |
39 | G_GNUC_SCANF(6, 7); | |
094a2239 | 40 | |
82a29e30 | 41 | /* Watch node/key unless node is empty, in which case watch key */ |
ba2a92db PD |
42 | struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node, |
43 | const char *key, xs_watch_fn fn, | |
44 | void *opaque, Error **errp); | |
45 | void xs_node_unwatch(struct qemu_xs_handle *h, struct qemu_xs_watch *w); | |
82a29e30 | 46 | |
094a2239 | 47 | #endif /* HW_XEN_BUS_HELPER_H */ |