2009-04-22 19:19:15 +04:00
|
|
|
#ifndef QEMU_HW_XEN_BACKEND_H
|
2016-06-29 16:29:06 +03:00
|
|
|
#define QEMU_HW_XEN_BACKEND_H
|
2009-04-22 19:19:15 +04:00
|
|
|
|
2013-02-05 20:06:20 +04:00
|
|
|
#include "hw/xen/xen_common.h"
|
2016-10-25 08:50:09 +03:00
|
|
|
#include "hw/xen/xen_pvdev.h"
|
2012-12-17 21:20:04 +04:00
|
|
|
#include "sysemu/sysemu.h"
|
2012-10-24 10:43:34 +04:00
|
|
|
#include "net/net.h"
|
2009-04-22 19:19:15 +04:00
|
|
|
|
2016-11-22 09:10:56 +03:00
|
|
|
#define TYPE_XENSYSDEV "xen-sysdev"
|
|
|
|
#define TYPE_XENSYSBUS "xen-sysbus"
|
2016-11-22 09:10:58 +03:00
|
|
|
#define TYPE_XENBACKEND "xen-backend"
|
|
|
|
|
|
|
|
#define XENBACKEND_DEVICE(obj) \
|
|
|
|
OBJECT_CHECK(XenDevice, (obj), TYPE_XENBACKEND)
|
2016-11-22 09:10:56 +03:00
|
|
|
|
2009-04-22 19:19:15 +04:00
|
|
|
/* variables */
|
|
|
|
extern struct xs_handle *xenstore;
|
2009-04-22 19:19:39 +04:00
|
|
|
extern const char *xen_protocol;
|
2017-09-22 15:07:24 +03:00
|
|
|
extern bool xen_feature_grant_copy;
|
2016-05-12 17:13:39 +03:00
|
|
|
extern DeviceState *xen_sysdev;
|
2016-11-22 09:10:56 +03:00
|
|
|
extern BusState *xen_sysbus;
|
2009-04-22 19:19:15 +04:00
|
|
|
|
2016-05-12 17:13:40 +03:00
|
|
|
int xenstore_mkdir(char *path, int p);
|
2009-04-22 19:19:15 +04:00
|
|
|
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val);
|
|
|
|
int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
|
2013-04-05 19:37:32 +04:00
|
|
|
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
|
2009-04-22 19:19:15 +04:00
|
|
|
char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
|
|
|
|
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
|
2016-10-25 08:50:10 +03:00
|
|
|
void xenstore_update_fe(char *watch, struct XenDevice *xendev);
|
|
|
|
void xenstore_update_be(char *watch, char *type, int dom,
|
|
|
|
struct XenDevOps *ops);
|
2009-04-22 19:19:15 +04:00
|
|
|
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
|
|
|
|
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
|
2016-10-25 08:50:08 +03:00
|
|
|
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
|
|
|
|
uint64_t *uval);
|
2009-04-22 19:19:15 +04:00
|
|
|
|
|
|
|
void xen_be_check_state(struct XenDevice *xendev);
|
|
|
|
|
|
|
|
/* xen backend driver bits */
|
|
|
|
int xen_be_init(void);
|
2016-08-02 09:32:32 +03:00
|
|
|
void xen_be_register_common(void);
|
2009-04-22 19:19:15 +04:00
|
|
|
int xen_be_register(const char *type, struct XenDevOps *ops);
|
|
|
|
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
|
|
|
|
int xen_be_bind_evtchn(struct XenDevice *xendev);
|
|
|
|
|
2009-04-22 19:19:19 +04:00
|
|
|
/* actual backend drivers */
|
|
|
|
extern struct XenDevOps xen_console_ops; /* xen_console.c */
|
2009-04-22 19:19:25 +04:00
|
|
|
extern struct XenDevOps xen_kbdmouse_ops; /* xen_framebuffer.c */
|
|
|
|
extern struct XenDevOps xen_framebuffer_ops; /* xen_framebuffer.c */
|
2009-04-22 19:19:30 +04:00
|
|
|
extern struct XenDevOps xen_blkdev_ops; /* xen_disk.c */
|
2017-03-22 20:17:09 +03:00
|
|
|
#ifdef CONFIG_VIRTFS
|
|
|
|
extern struct XenDevOps xen_9pfs_ops; /* xen-9p-backend.c */
|
|
|
|
#endif
|
2009-04-22 19:19:35 +04:00
|
|
|
extern struct XenDevOps xen_netdev_ops; /* xen_nic.c */
|
2016-05-12 17:13:41 +03:00
|
|
|
#ifdef CONFIG_USB_LIBUSB
|
|
|
|
extern struct XenDevOps xen_usb_ops; /* xen-usb.c */
|
|
|
|
#endif
|
2009-04-22 19:19:25 +04:00
|
|
|
|
2009-04-22 19:19:39 +04:00
|
|
|
/* configuration (aka xenbus setup) */
|
2010-03-21 22:13:02 +03:00
|
|
|
void xen_config_cleanup(void);
|
2009-04-22 19:19:39 +04:00
|
|
|
int xen_config_dev_blk(DriveInfo *disk);
|
|
|
|
int xen_config_dev_nic(NICInfo *nic);
|
2009-04-22 19:19:44 +04:00
|
|
|
int xen_config_dev_vfb(int vdev, const char *type);
|
|
|
|
int xen_config_dev_vkbd(int vdev);
|
|
|
|
int xen_config_dev_console(int vdev);
|
2009-04-22 19:19:39 +04:00
|
|
|
|
2009-04-22 19:19:15 +04:00
|
|
|
#endif /* QEMU_HW_XEN_BACKEND_H */
|