xen-backend.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_BACKEND_H
  8. #define HW_XEN_BACKEND_H
  9. #include "hw/xen/xen-bus.h"
  10. typedef struct XenBackendInstance XenBackendInstance;
  11. typedef void (*XenBackendDeviceCreate)(XenBackendInstance *backend,
  12. QDict *opts, Error **errp);
  13. typedef void (*XenBackendDeviceDestroy)(XenBackendInstance *backend,
  14. Error **errp);
  15. typedef struct XenBackendInfo {
  16. const char *type;
  17. XenBackendDeviceCreate create;
  18. XenBackendDeviceDestroy destroy;
  19. } XenBackendInfo;
  20. XenBus *xen_backend_get_bus(XenBackendInstance *backend);
  21. const char *xen_backend_get_name(XenBackendInstance *backend);
  22. void xen_backend_set_device(XenBackendInstance *backend,
  23. XenDevice *xendevice);
  24. XenDevice *xen_backend_get_device(XenBackendInstance *backend);
  25. void xen_backend_register(const XenBackendInfo *info);
  26. const char **xen_backend_get_types(unsigned int *nr);
  27. void xen_backend_device_create(XenBus *xenbus, const char *type,
  28. const char *name, QDict *opts, Error **errp);
  29. bool xen_backend_try_device_destroy(XenDevice *xendev, Error **errp);
  30. #endif /* HW_XEN_BACKEND_H */