xen/9pfs: build and register Xen 9pfs backend
[qemu.git] / include / hw / xen / xen_backend.h
blob852c2ea64c6be0414a805cc9890863723fa5aba6
1 #ifndef QEMU_HW_XEN_BACKEND_H
2 #define QEMU_HW_XEN_BACKEND_H
4 #include "hw/xen/xen_common.h"
5 #include "hw/xen/xen_pvdev.h"
6 #include "sysemu/sysemu.h"
7 #include "net/net.h"
9 #define TYPE_XENSYSDEV "xen-sysdev"
10 #define TYPE_XENSYSBUS "xen-sysbus"
11 #define TYPE_XENBACKEND "xen-backend"
13 #define XENBACKEND_DEVICE(obj) \
14 OBJECT_CHECK(XenDevice, (obj), TYPE_XENBACKEND)
16 /* variables */
17 extern struct xs_handle *xenstore;
18 extern const char *xen_protocol;
19 extern DeviceState *xen_sysdev;
20 extern BusState *xen_sysbus;
22 int xenstore_mkdir(char *path, int p);
23 int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val);
24 int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
25 int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
26 char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
27 int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
28 void xenstore_update_fe(char *watch, struct XenDevice *xendev);
29 void xenstore_update_be(char *watch, char *type, int dom,
30 struct XenDevOps *ops);
31 char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
32 int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
33 int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
34 uint64_t *uval);
36 void xen_be_check_state(struct XenDevice *xendev);
38 /* xen backend driver bits */
39 int xen_be_init(void);
40 void xen_be_register_common(void);
41 int xen_be_register(const char *type, struct XenDevOps *ops);
42 int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
43 int xen_be_bind_evtchn(struct XenDevice *xendev);
45 /* actual backend drivers */
46 extern struct XenDevOps xen_console_ops; /* xen_console.c */
47 extern struct XenDevOps xen_kbdmouse_ops; /* xen_framebuffer.c */
48 extern struct XenDevOps xen_framebuffer_ops; /* xen_framebuffer.c */
49 extern struct XenDevOps xen_blkdev_ops; /* xen_disk.c */
50 #ifdef CONFIG_VIRTFS
51 extern struct XenDevOps xen_9pfs_ops; /* xen-9p-backend.c */
52 #endif
53 extern struct XenDevOps xen_netdev_ops; /* xen_nic.c */
54 #ifdef CONFIG_USB_LIBUSB
55 extern struct XenDevOps xen_usb_ops; /* xen-usb.c */
56 #endif
58 void xen_init_display(int domid);
60 /* configuration (aka xenbus setup) */
61 void xen_config_cleanup(void);
62 int xen_config_dev_blk(DriveInfo *disk);
63 int xen_config_dev_nic(NICInfo *nic);
64 int xen_config_dev_vfb(int vdev, const char *type);
65 int xen_config_dev_vkbd(int vdev);
66 int xen_config_dev_console(int vdev);
68 #endif /* QEMU_HW_XEN_BACKEND_H */