2019-01-08 17:48:49 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Citrix Systems Inc.
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_XEN_BUS_HELPER_H
|
|
|
|
#define HW_XEN_BUS_HELPER_H
|
|
|
|
|
2023-01-02 14:05:16 +03:00
|
|
|
#include "hw/xen/xen_backend_ops.h"
|
2019-01-08 17:48:49 +03:00
|
|
|
|
|
|
|
const char *xs_strstate(enum xenbus_state state);
|
|
|
|
|
2023-01-02 14:05:16 +03:00
|
|
|
void xs_node_create(struct qemu_xs_handle *h, xs_transaction_t tid,
|
|
|
|
const char *node, unsigned int owner, unsigned int domid,
|
|
|
|
unsigned int perms, Error **errp);
|
|
|
|
void xs_node_destroy(struct qemu_xs_handle *h, xs_transaction_t tid,
|
2019-01-08 17:48:49 +03:00
|
|
|
const char *node, Error **errp);
|
|
|
|
|
|
|
|
/* Write to node/key unless node is empty, in which case write to key */
|
2023-01-02 14:05:16 +03:00
|
|
|
void xs_node_vprintf(struct qemu_xs_handle *h, xs_transaction_t tid,
|
2019-01-08 17:48:49 +03:00
|
|
|
const char *node, const char *key, Error **errp,
|
|
|
|
const char *fmt, va_list ap)
|
2022-02-20 19:39:25 +03:00
|
|
|
G_GNUC_PRINTF(6, 0);
|
2023-01-02 14:05:16 +03:00
|
|
|
void xs_node_printf(struct qemu_xs_handle *h, xs_transaction_t tid,
|
2019-01-08 17:48:49 +03:00
|
|
|
const char *node, const char *key, Error **errp,
|
|
|
|
const char *fmt, ...)
|
2022-02-20 19:39:25 +03:00
|
|
|
G_GNUC_PRINTF(6, 7);
|
2019-01-08 17:48:49 +03:00
|
|
|
|
|
|
|
/* Read from node/key unless node is empty, in which case read from key */
|
2023-01-02 14:05:16 +03:00
|
|
|
int xs_node_vscanf(struct qemu_xs_handle *h, xs_transaction_t tid,
|
2019-01-08 17:48:49 +03:00
|
|
|
const char *node, const char *key, Error **errp,
|
2022-12-19 16:02:01 +03:00
|
|
|
const char *fmt, va_list ap)
|
|
|
|
G_GNUC_SCANF(6, 0);
|
2023-01-02 14:05:16 +03:00
|
|
|
int xs_node_scanf(struct qemu_xs_handle *h, xs_transaction_t tid,
|
2019-01-08 17:48:49 +03:00
|
|
|
const char *node, const char *key, Error **errp,
|
2022-12-19 16:02:01 +03:00
|
|
|
const char *fmt, ...)
|
|
|
|
G_GNUC_SCANF(6, 7);
|
2019-01-08 17:48:49 +03:00
|
|
|
|
2019-01-08 17:48:50 +03:00
|
|
|
/* Watch node/key unless node is empty, in which case watch key */
|
2023-01-02 14:05:16 +03:00
|
|
|
struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node,
|
|
|
|
const char *key, xs_watch_fn fn,
|
|
|
|
void *opaque, Error **errp);
|
|
|
|
void xs_node_unwatch(struct qemu_xs_handle *h, struct qemu_xs_watch *w);
|
2019-01-08 17:48:50 +03:00
|
|
|
|
2019-01-08 17:48:49 +03:00
|
|
|
#endif /* HW_XEN_BUS_HELPER_H */
|