2 * xen backend driver infrastructure
3 * (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; under version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Contributions after 2012-01-13 are licensed under the terms of the
18 * GNU GPL, version 2 or (at your option) any later version.
22 * TODO: add some xenbus / xenstore concepts overview here.
25 #include "qemu/osdep.h"
26 #include <sys/signal.h>
29 #include "hw/sysbus.h"
30 #include "sysemu/char.h"
32 #include "hw/xen/xen_backend.h"
34 #include <xen/grant_table.h>
36 #define TYPE_XENSYSDEV "xensysdev"
38 DeviceState
*xen_sysdev
;
40 /* ------------------------------------------------------------- */
43 xc_interface
*xen_xc
= NULL
;
44 xenforeignmemory_handle
*xen_fmem
= NULL
;
45 struct xs_handle
*xenstore
= NULL
;
46 const char *xen_protocol
;
51 QTAILQ_ENTRY(xs_dirs
) list
;
53 static QTAILQ_HEAD(xs_dirs_head
, xs_dirs
) xs_cleanup
=
54 QTAILQ_HEAD_INITIALIZER(xs_cleanup
);
56 static QTAILQ_HEAD(XenDeviceHead
, XenDevice
) xendevs
= QTAILQ_HEAD_INITIALIZER(xendevs
);
59 /* ------------------------------------------------------------- */
61 static void xenstore_cleanup_dir(char *dir
)
65 d
= g_malloc(sizeof(*d
));
67 QTAILQ_INSERT_TAIL(&xs_cleanup
, d
, list
);
70 void xen_config_cleanup(void)
74 QTAILQ_FOREACH(d
, &xs_cleanup
, list
) {
75 xs_rm(xenstore
, 0, d
->xs_dir
);
79 int xenstore_write_str(const char *base
, const char *node
, const char *val
)
81 char abspath
[XEN_BUFSIZE
];
83 snprintf(abspath
, sizeof(abspath
), "%s/%s", base
, node
);
84 if (!xs_write(xenstore
, 0, abspath
, val
, strlen(val
))) {
90 char *xenstore_read_str(const char *base
, const char *node
)
92 char abspath
[XEN_BUFSIZE
];
94 char *str
, *ret
= NULL
;
96 snprintf(abspath
, sizeof(abspath
), "%s/%s", base
, node
);
97 str
= xs_read(xenstore
, 0, abspath
, &len
);
99 /* move to qemu-allocated memory to make sure
100 * callers can savely g_free() stuff. */
107 int xenstore_mkdir(char *path
, int p
)
109 struct xs_permissions perms
[2] = {
111 .id
= 0, /* set owner: dom0 */
118 if (!xs_mkdir(xenstore
, 0, path
)) {
119 xen_be_printf(NULL
, 0, "xs_mkdir %s: failed\n", path
);
122 xenstore_cleanup_dir(g_strdup(path
));
124 if (!xs_set_permissions(xenstore
, 0, path
, perms
, 2)) {
125 xen_be_printf(NULL
, 0, "xs_set_permissions %s: failed\n", path
);
131 int xenstore_write_int(const char *base
, const char *node
, int ival
)
135 snprintf(val
, sizeof(val
), "%d", ival
);
136 return xenstore_write_str(base
, node
, val
);
139 int xenstore_write_int64(const char *base
, const char *node
, int64_t ival
)
143 snprintf(val
, sizeof(val
), "%"PRId64
, ival
);
144 return xenstore_write_str(base
, node
, val
);
147 int xenstore_read_int(const char *base
, const char *node
, int *ival
)
152 val
= xenstore_read_str(base
, node
);
153 if (val
&& 1 == sscanf(val
, "%d", ival
)) {
160 int xenstore_read_uint64(const char *base
, const char *node
, uint64_t *uval
)
165 val
= xenstore_read_str(base
, node
);
166 if (val
&& 1 == sscanf(val
, "%"SCNu64
, uval
)) {
173 int xenstore_write_be_str(struct XenDevice
*xendev
, const char *node
, const char *val
)
175 return xenstore_write_str(xendev
->be
, node
, val
);
178 int xenstore_write_be_int(struct XenDevice
*xendev
, const char *node
, int ival
)
180 return xenstore_write_int(xendev
->be
, node
, ival
);
183 int xenstore_write_be_int64(struct XenDevice
*xendev
, const char *node
, int64_t ival
)
185 return xenstore_write_int64(xendev
->be
, node
, ival
);
188 char *xenstore_read_be_str(struct XenDevice
*xendev
, const char *node
)
190 return xenstore_read_str(xendev
->be
, node
);
193 int xenstore_read_be_int(struct XenDevice
*xendev
, const char *node
, int *ival
)
195 return xenstore_read_int(xendev
->be
, node
, ival
);
198 char *xenstore_read_fe_str(struct XenDevice
*xendev
, const char *node
)
200 return xenstore_read_str(xendev
->fe
, node
);
203 int xenstore_read_fe_int(struct XenDevice
*xendev
, const char *node
, int *ival
)
205 return xenstore_read_int(xendev
->fe
, node
, ival
);
208 int xenstore_read_fe_uint64(struct XenDevice
*xendev
, const char *node
, uint64_t *uval
)
210 return xenstore_read_uint64(xendev
->fe
, node
, uval
);
213 /* ------------------------------------------------------------- */
215 const char *xenbus_strstate(enum xenbus_state state
)
217 static const char *const name
[] = {
218 [ XenbusStateUnknown
] = "Unknown",
219 [ XenbusStateInitialising
] = "Initialising",
220 [ XenbusStateInitWait
] = "InitWait",
221 [ XenbusStateInitialised
] = "Initialised",
222 [ XenbusStateConnected
] = "Connected",
223 [ XenbusStateClosing
] = "Closing",
224 [ XenbusStateClosed
] = "Closed",
226 return (state
< ARRAY_SIZE(name
)) ? name
[state
] : "INVALID";
229 int xen_be_set_state(struct XenDevice
*xendev
, enum xenbus_state state
)
233 rc
= xenstore_write_be_int(xendev
, "state", state
);
237 xen_be_printf(xendev
, 1, "backend state: %s -> %s\n",
238 xenbus_strstate(xendev
->be_state
), xenbus_strstate(state
));
239 xendev
->be_state
= state
;
243 /* ------------------------------------------------------------- */
245 struct XenDevice
*xen_be_find_xendev(const char *type
, int dom
, int dev
)
247 struct XenDevice
*xendev
;
249 QTAILQ_FOREACH(xendev
, &xendevs
, next
) {
250 if (xendev
->dom
!= dom
) {
253 if (xendev
->dev
!= dev
) {
256 if (strcmp(xendev
->type
, type
) != 0) {
265 * get xen backend device, allocate a new one if it doesn't exist.
267 static struct XenDevice
*xen_be_get_xendev(const char *type
, int dom
, int dev
,
268 struct XenDevOps
*ops
)
270 struct XenDevice
*xendev
;
272 xendev
= xen_be_find_xendev(type
, dom
, dev
);
277 /* init new xendev */
278 xendev
= g_malloc0(ops
->size
);
284 snprintf(xendev
->be
, sizeof(xendev
->be
), "backend/%s/%d/%d",
285 xendev
->type
, xendev
->dom
, xendev
->dev
);
286 snprintf(xendev
->name
, sizeof(xendev
->name
), "%s-%d",
287 xendev
->type
, xendev
->dev
);
289 xendev
->debug
= debug
;
290 xendev
->local_port
= -1;
292 xendev
->evtchndev
= xenevtchn_open(NULL
, 0);
293 if (xendev
->evtchndev
== NULL
) {
294 xen_be_printf(NULL
, 0, "can't open evtchn device\n");
298 fcntl(xenevtchn_fd(xendev
->evtchndev
), F_SETFD
, FD_CLOEXEC
);
300 if (ops
->flags
& DEVOPS_FLAG_NEED_GNTDEV
) {
301 xendev
->gnttabdev
= xengnttab_open(NULL
, 0);
302 if (xendev
->gnttabdev
== NULL
) {
303 xen_be_printf(NULL
, 0, "can't open gnttab device\n");
304 xenevtchn_close(xendev
->evtchndev
);
309 xendev
->gnttabdev
= NULL
;
312 QTAILQ_INSERT_TAIL(&xendevs
, xendev
, next
);
314 if (xendev
->ops
->alloc
) {
315 xendev
->ops
->alloc(xendev
);
322 * release xen backend device.
324 static void xen_be_del_xendev(struct XenDevice
*xendev
)
326 if (xendev
->ops
->free
) {
327 xendev
->ops
->free(xendev
);
331 char token
[XEN_BUFSIZE
];
332 snprintf(token
, sizeof(token
), "fe:%p", xendev
);
333 xs_unwatch(xenstore
, xendev
->fe
, token
);
337 if (xendev
->evtchndev
!= NULL
) {
338 xenevtchn_close(xendev
->evtchndev
);
340 if (xendev
->gnttabdev
!= NULL
) {
341 xengnttab_close(xendev
->gnttabdev
);
344 QTAILQ_REMOVE(&xendevs
, xendev
, next
);
349 * Sync internal data structures on xenstore updates.
350 * Node specifies the changed field. node = NULL means
351 * update all fields (used for initialization).
353 static void xen_be_backend_changed(struct XenDevice
*xendev
, const char *node
)
355 if (node
== NULL
|| strcmp(node
, "online") == 0) {
356 if (xenstore_read_be_int(xendev
, "online", &xendev
->online
) == -1) {
362 xen_be_printf(xendev
, 2, "backend update: %s\n", node
);
363 if (xendev
->ops
->backend_changed
) {
364 xendev
->ops
->backend_changed(xendev
, node
);
369 static void xen_be_frontend_changed(struct XenDevice
*xendev
, const char *node
)
373 if (node
== NULL
|| strcmp(node
, "state") == 0) {
374 if (xenstore_read_fe_int(xendev
, "state", &fe_state
) == -1) {
375 fe_state
= XenbusStateUnknown
;
377 if (xendev
->fe_state
!= fe_state
) {
378 xen_be_printf(xendev
, 1, "frontend state: %s -> %s\n",
379 xenbus_strstate(xendev
->fe_state
),
380 xenbus_strstate(fe_state
));
382 xendev
->fe_state
= fe_state
;
384 if (node
== NULL
|| strcmp(node
, "protocol") == 0) {
385 g_free(xendev
->protocol
);
386 xendev
->protocol
= xenstore_read_fe_str(xendev
, "protocol");
387 if (xendev
->protocol
) {
388 xen_be_printf(xendev
, 1, "frontend protocol: %s\n", xendev
->protocol
);
393 xen_be_printf(xendev
, 2, "frontend update: %s\n", node
);
394 if (xendev
->ops
->frontend_changed
) {
395 xendev
->ops
->frontend_changed(xendev
, node
);
400 /* ------------------------------------------------------------- */
401 /* Check for possible state transitions and perform them. */
404 * Initial xendev setup. Read frontend path, register watch for it.
405 * Should succeed once xend finished setting up the backend device.
407 * Also sets initial state (-> Initializing) when done. Which
408 * only affects the xendev->be_state variable as xenbus should
409 * already be put into that state by xend.
411 static int xen_be_try_setup(struct XenDevice
*xendev
)
413 char token
[XEN_BUFSIZE
];
416 if (xenstore_read_be_int(xendev
, "state", &be_state
) == -1) {
417 xen_be_printf(xendev
, 0, "reading backend state failed\n");
421 if (be_state
!= XenbusStateInitialising
) {
422 xen_be_printf(xendev
, 0, "initial backend state is wrong (%s)\n",
423 xenbus_strstate(be_state
));
427 xendev
->fe
= xenstore_read_be_str(xendev
, "frontend");
428 if (xendev
->fe
== NULL
) {
429 xen_be_printf(xendev
, 0, "reading frontend path failed\n");
433 /* setup frontend watch */
434 snprintf(token
, sizeof(token
), "fe:%p", xendev
);
435 if (!xs_watch(xenstore
, xendev
->fe
, token
)) {
436 xen_be_printf(xendev
, 0, "watching frontend path (%s) failed\n",
440 xen_be_set_state(xendev
, XenbusStateInitialising
);
442 xen_be_backend_changed(xendev
, NULL
);
443 xen_be_frontend_changed(xendev
, NULL
);
448 * Try initialize xendev. Prepare everything the backend can do
449 * without synchronizing with the frontend. Fakes hotplug-status. No
450 * hotplug involved here because this is about userspace drivers, thus
451 * there are kernel backend devices which could invoke hotplug.
453 * Goes to InitWait on success.
455 static int xen_be_try_init(struct XenDevice
*xendev
)
459 if (!xendev
->online
) {
460 xen_be_printf(xendev
, 1, "not online\n");
464 if (xendev
->ops
->init
) {
465 rc
= xendev
->ops
->init(xendev
);
468 xen_be_printf(xendev
, 1, "init() failed\n");
472 xenstore_write_be_str(xendev
, "hotplug-status", "connected");
473 xen_be_set_state(xendev
, XenbusStateInitWait
);
478 * Try to initialise xendev. Depends on the frontend being ready
479 * for it (shared ring and evtchn info in xenstore, state being
480 * Initialised or Connected).
482 * Goes to Connected on success.
484 static int xen_be_try_initialise(struct XenDevice
*xendev
)
488 if (xendev
->fe_state
!= XenbusStateInitialised
&&
489 xendev
->fe_state
!= XenbusStateConnected
) {
490 if (xendev
->ops
->flags
& DEVOPS_FLAG_IGNORE_STATE
) {
491 xen_be_printf(xendev
, 2, "frontend not ready, ignoring\n");
493 xen_be_printf(xendev
, 2, "frontend not ready (yet)\n");
498 if (xendev
->ops
->initialise
) {
499 rc
= xendev
->ops
->initialise(xendev
);
502 xen_be_printf(xendev
, 0, "initialise() failed\n");
506 xen_be_set_state(xendev
, XenbusStateConnected
);
511 * Try to let xendev know that it is connected. Depends on the
512 * frontend being Connected. Note that this may be called more
513 * than once since the backend state is not modified.
515 static void xen_be_try_connected(struct XenDevice
*xendev
)
517 if (!xendev
->ops
->connected
) {
521 if (xendev
->fe_state
!= XenbusStateConnected
) {
522 if (xendev
->ops
->flags
& DEVOPS_FLAG_IGNORE_STATE
) {
523 xen_be_printf(xendev
, 2, "frontend not ready, ignoring\n");
525 xen_be_printf(xendev
, 2, "frontend not ready (yet)\n");
530 xendev
->ops
->connected(xendev
);
534 * Teardown connection.
536 * Goes to Closed when done.
538 static void xen_be_disconnect(struct XenDevice
*xendev
, enum xenbus_state state
)
540 if (xendev
->be_state
!= XenbusStateClosing
&&
541 xendev
->be_state
!= XenbusStateClosed
&&
542 xendev
->ops
->disconnect
) {
543 xendev
->ops
->disconnect(xendev
);
545 if (xendev
->be_state
!= state
) {
546 xen_be_set_state(xendev
, state
);
551 * Try to reset xendev, for reconnection by another frontend instance.
553 static int xen_be_try_reset(struct XenDevice
*xendev
)
555 if (xendev
->fe_state
!= XenbusStateInitialising
) {
559 xen_be_printf(xendev
, 1, "device reset (for re-connect)\n");
560 xen_be_set_state(xendev
, XenbusStateInitialising
);
565 * state change dispatcher function
567 void xen_be_check_state(struct XenDevice
*xendev
)
571 /* frontend may request shutdown from almost anywhere */
572 if (xendev
->fe_state
== XenbusStateClosing
||
573 xendev
->fe_state
== XenbusStateClosed
) {
574 xen_be_disconnect(xendev
, xendev
->fe_state
);
578 /* check for possible backend state transitions */
580 switch (xendev
->be_state
) {
581 case XenbusStateUnknown
:
582 rc
= xen_be_try_setup(xendev
);
584 case XenbusStateInitialising
:
585 rc
= xen_be_try_init(xendev
);
587 case XenbusStateInitWait
:
588 rc
= xen_be_try_initialise(xendev
);
590 case XenbusStateConnected
:
591 /* xendev->be_state doesn't change */
592 xen_be_try_connected(xendev
);
595 case XenbusStateClosed
:
596 rc
= xen_be_try_reset(xendev
);
607 /* ------------------------------------------------------------- */
609 static int xenstore_scan(const char *type
, int dom
, struct XenDevOps
*ops
)
611 struct XenDevice
*xendev
;
612 char path
[XEN_BUFSIZE
], token
[XEN_BUFSIZE
];
614 unsigned int cdev
, j
;
617 snprintf(token
, sizeof(token
), "be:%p:%d:%p", type
, dom
, ops
);
618 snprintf(path
, sizeof(path
), "backend/%s/%d", type
, dom
);
619 if (!xs_watch(xenstore
, path
, token
)) {
620 xen_be_printf(NULL
, 0, "xen be: watching backend path (%s) failed\n", path
);
624 /* look for backends */
625 dev
= xs_directory(xenstore
, 0, path
, &cdev
);
629 for (j
= 0; j
< cdev
; j
++) {
630 xendev
= xen_be_get_xendev(type
, dom
, atoi(dev
[j
]), ops
);
631 if (xendev
== NULL
) {
634 xen_be_check_state(xendev
);
640 static void xenstore_update_be(char *watch
, char *type
, int dom
,
641 struct XenDevOps
*ops
)
643 struct XenDevice
*xendev
;
644 char path
[XEN_BUFSIZE
], *bepath
;
645 unsigned int len
, dev
;
647 len
= snprintf(path
, sizeof(path
), "backend/%s/%d", type
, dom
);
648 if (strncmp(path
, watch
, len
) != 0) {
651 if (sscanf(watch
+len
, "/%u/%255s", &dev
, path
) != 2) {
653 if (sscanf(watch
+len
, "/%u", &dev
) != 1) {
661 xendev
= xen_be_get_xendev(type
, dom
, dev
, ops
);
662 if (xendev
!= NULL
) {
663 bepath
= xs_read(xenstore
, 0, xendev
->be
, &len
);
664 if (bepath
== NULL
) {
665 xen_be_del_xendev(xendev
);
668 xen_be_backend_changed(xendev
, path
);
669 xen_be_check_state(xendev
);
674 static void xenstore_update_fe(char *watch
, struct XenDevice
*xendev
)
679 len
= strlen(xendev
->fe
);
680 if (strncmp(xendev
->fe
, watch
, len
) != 0) {
683 if (watch
[len
] != '/') {
686 node
= watch
+ len
+ 1;
688 xen_be_frontend_changed(xendev
, node
);
689 xen_be_check_state(xendev
);
692 static void xenstore_update(void *unused
)
695 intptr_t type
, ops
, ptr
;
696 unsigned int dom
, count
;
698 vec
= xs_read_watch(xenstore
, &count
);
703 if (sscanf(vec
[XS_WATCH_TOKEN
], "be:%" PRIxPTR
":%d:%" PRIxPTR
,
704 &type
, &dom
, &ops
) == 3) {
705 xenstore_update_be(vec
[XS_WATCH_PATH
], (void*)type
, dom
, (void*)ops
);
707 if (sscanf(vec
[XS_WATCH_TOKEN
], "fe:%" PRIxPTR
, &ptr
) == 1) {
708 xenstore_update_fe(vec
[XS_WATCH_PATH
], (void*)ptr
);
715 static void xen_be_evtchn_event(void *opaque
)
717 struct XenDevice
*xendev
= opaque
;
720 port
= xenevtchn_pending(xendev
->evtchndev
);
721 if (port
!= xendev
->local_port
) {
722 xen_be_printf(xendev
, 0,
723 "xenevtchn_pending returned %d (expected %d)\n",
724 port
, xendev
->local_port
);
727 xenevtchn_unmask(xendev
->evtchndev
, port
);
729 if (xendev
->ops
->event
) {
730 xendev
->ops
->event(xendev
);
734 /* -------------------------------------------------------------------- */
736 int xen_be_init(void)
738 xenstore
= xs_daemon_open();
740 xen_be_printf(NULL
, 0, "can't connect to xenstored\n");
744 qemu_set_fd_handler(xs_fileno(xenstore
), xenstore_update
, NULL
, NULL
);
746 if (xen_xc
== NULL
|| xen_fmem
== NULL
) {
747 /* Check if xen_init() have been called */
751 xen_sysdev
= qdev_create(NULL
, TYPE_XENSYSDEV
);
752 qdev_init_nofail(xen_sysdev
);
757 qemu_set_fd_handler(xs_fileno(xenstore
), NULL
, NULL
, NULL
);
758 xs_daemon_close(xenstore
);
764 int xen_be_register(const char *type
, struct XenDevOps
*ops
)
769 if (ops
->backend_register
) {
770 rc
= ops
->backend_register();
776 snprintf(path
, sizeof(path
), "device-model/%u/backends/%s", xen_domid
,
778 xenstore_mkdir(path
, XS_PERM_NONE
);
780 return xenstore_scan(type
, xen_domid
, ops
);
783 void xen_be_register_common(void)
785 xen_be_register("console", &xen_console_ops
);
786 xen_be_register("vkbd", &xen_kbdmouse_ops
);
787 xen_be_register("qdisk", &xen_blkdev_ops
);
788 #ifdef CONFIG_USB_LIBUSB
789 xen_be_register("qusb", &xen_usb_ops
);
793 int xen_be_bind_evtchn(struct XenDevice
*xendev
)
795 if (xendev
->local_port
!= -1) {
798 xendev
->local_port
= xenevtchn_bind_interdomain
799 (xendev
->evtchndev
, xendev
->dom
, xendev
->remote_port
);
800 if (xendev
->local_port
== -1) {
801 xen_be_printf(xendev
, 0, "xenevtchn_bind_interdomain failed\n");
804 xen_be_printf(xendev
, 2, "bind evtchn port %d\n", xendev
->local_port
);
805 qemu_set_fd_handler(xenevtchn_fd(xendev
->evtchndev
),
806 xen_be_evtchn_event
, NULL
, xendev
);
810 void xen_be_unbind_evtchn(struct XenDevice
*xendev
)
812 if (xendev
->local_port
== -1) {
815 qemu_set_fd_handler(xenevtchn_fd(xendev
->evtchndev
), NULL
, NULL
, NULL
);
816 xenevtchn_unbind(xendev
->evtchndev
, xendev
->local_port
);
817 xen_be_printf(xendev
, 2, "unbind evtchn port %d\n", xendev
->local_port
);
818 xendev
->local_port
= -1;
821 int xen_be_send_notify(struct XenDevice
*xendev
)
823 return xenevtchn_notify(xendev
->evtchndev
, xendev
->local_port
);
828 * 0 == errors (stderr + logfile).
829 * 1 == informative debug messages (logfile only).
830 * 2 == noisy debug messages (logfile only).
831 * 3 == will flood your log (logfile only).
833 void xen_be_printf(struct XenDevice
*xendev
, int msg_level
, const char *fmt
, ...)
838 if (msg_level
> xendev
->debug
) {
841 qemu_log("xen be: %s: ", xendev
->name
);
842 if (msg_level
== 0) {
843 fprintf(stderr
, "xen be: %s: ", xendev
->name
);
846 if (msg_level
> debug
) {
849 qemu_log("xen be core: ");
850 if (msg_level
== 0) {
851 fprintf(stderr
, "xen be core: ");
855 qemu_log_vprintf(fmt
, args
);
857 if (msg_level
== 0) {
859 vfprintf(stderr
, fmt
, args
);
865 static int xen_sysdev_init(SysBusDevice
*dev
)
870 static Property xen_sysdev_properties
[] = {
871 {/* end of property list */},
874 static void xen_sysdev_class_init(ObjectClass
*klass
, void *data
)
876 DeviceClass
*dc
= DEVICE_CLASS(klass
);
877 SysBusDeviceClass
*k
= SYS_BUS_DEVICE_CLASS(klass
);
879 k
->init
= xen_sysdev_init
;
880 dc
->props
= xen_sysdev_properties
;
883 static const TypeInfo xensysdev_info
= {
884 .name
= TYPE_XENSYSDEV
,
885 .parent
= TYPE_SYS_BUS_DEVICE
,
886 .instance_size
= sizeof(SysBusDevice
),
887 .class_init
= xen_sysdev_class_init
,
890 static void xenbe_register_types(void)
892 type_register_static(&xensysdev_info
);
895 type_init(xenbe_register_types
);