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