Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / xen / xen-backend.h
blob0f01631ae7a44bb8eb322869b1c4c958a5bbaf13
1 /*
2 * Copyright (c) 2018 Citrix Systems Inc.
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 */
8 #ifndef HW_XEN_BACKEND_H
9 #define HW_XEN_BACKEND_H
11 #include "hw/xen/xen-bus.h"
13 typedef struct XenBackendInstance XenBackendInstance;
15 typedef void (*XenBackendDeviceCreate)(XenBackendInstance *backend,
16 QDict *opts, Error **errp);
17 typedef void (*XenBackendDeviceDestroy)(XenBackendInstance *backend,
18 Error **errp);
20 typedef struct XenBackendInfo {
21 const char *type;
22 XenBackendDeviceCreate create;
23 XenBackendDeviceDestroy destroy;
24 } XenBackendInfo;
26 XenBus *xen_backend_get_bus(XenBackendInstance *backend);
27 const char *xen_backend_get_name(XenBackendInstance *backend);
29 void xen_backend_set_device(XenBackendInstance *backend,
30 XenDevice *xendevice);
31 XenDevice *xen_backend_get_device(XenBackendInstance *backend);
33 void xen_backend_register(const XenBackendInfo *info);
34 const char **xen_backend_get_types(unsigned int *nr);
36 bool xen_backend_exists(const char *type, const char *name);
37 void xen_backend_device_create(XenBus *xenbus, const char *type,
38 const char *name, QDict *opts, Error **errp);
39 bool xen_backend_try_device_destroy(XenDevice *xendev, Error **errp);
41 #endif /* HW_XEN_BACKEND_H */