xen-bus-helper.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #ifndef HW_XEN_BUS_HELPER_H
  8. #define HW_XEN_BUS_HELPER_H
  9. #include "hw/xen/xen_backend_ops.h"
  10. const char *xs_strstate(enum xenbus_state state);
  11. void xs_node_create(struct qemu_xs_handle *h, xs_transaction_t tid,
  12. const char *node, unsigned int owner, unsigned int domid,
  13. unsigned int perms, Error **errp);
  14. void xs_node_destroy(struct qemu_xs_handle *h, xs_transaction_t tid,
  15. const char *node, Error **errp);
  16. /* Write to node/key unless node is empty, in which case write to key */
  17. void xs_node_vprintf(struct qemu_xs_handle *h, xs_transaction_t tid,
  18. const char *node, const char *key, Error **errp,
  19. const char *fmt, va_list ap)
  20. G_GNUC_PRINTF(6, 0);
  21. void xs_node_printf(struct qemu_xs_handle *h, xs_transaction_t tid,
  22. const char *node, const char *key, Error **errp,
  23. const char *fmt, ...)
  24. G_GNUC_PRINTF(6, 7);
  25. /* Read from node/key unless node is empty, in which case read from key */
  26. int xs_node_vscanf(struct qemu_xs_handle *h, xs_transaction_t tid,
  27. const char *node, const char *key, Error **errp,
  28. const char *fmt, va_list ap)
  29. G_GNUC_SCANF(6, 0);
  30. int xs_node_scanf(struct qemu_xs_handle *h, xs_transaction_t tid,
  31. const char *node, const char *key, Error **errp,
  32. const char *fmt, ...)
  33. G_GNUC_SCANF(6, 7);
  34. /* Watch node/key unless node is empty, in which case watch key */
  35. struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node,
  36. const char *key, xs_watch_fn fn,
  37. void *opaque, Error **errp);
  38. void xs_node_unwatch(struct qemu_xs_handle *h, struct qemu_xs_watch *w);
  39. #endif /* HW_XEN_BUS_HELPER_H */