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 struct XenDevice
*xen_be_del_xendev(int dom
, int dev
)
326 struct XenDevice
*xendev
, *xnext
;
329 * This is pretty much like QTAILQ_FOREACH(xendev, &xendevs, next) but
330 * we save the next pointer in xnext because we might free xendev.
332 xnext
= xendevs
.tqh_first
;
335 xnext
= xendev
->next
.tqe_next
;
337 if (xendev
->dom
!= dom
) {
340 if (xendev
->dev
!= dev
&& dev
!= -1) {
344 if (xendev
->ops
->free
) {
345 xendev
->ops
->free(xendev
);
349 char token
[XEN_BUFSIZE
];
350 snprintf(token
, sizeof(token
), "fe:%p", xendev
);
351 xs_unwatch(xenstore
, xendev
->fe
, token
);
355 if (xendev
->evtchndev
!= NULL
) {
356 xenevtchn_close(xendev
->evtchndev
);
358 if (xendev
->gnttabdev
!= NULL
) {
359 xengnttab_close(xendev
->gnttabdev
);
362 QTAILQ_REMOVE(&xendevs
, xendev
, next
);
369 * Sync internal data structures on xenstore updates.
370 * Node specifies the changed field. node = NULL means
371 * update all fields (used for initialization).
373 static void xen_be_backend_changed(struct XenDevice
*xendev
, const char *node
)
375 if (node
== NULL
|| strcmp(node
, "online") == 0) {
376 if (xenstore_read_be_int(xendev
, "online", &xendev
->online
) == -1) {
382 xen_be_printf(xendev
, 2, "backend update: %s\n", node
);
383 if (xendev
->ops
->backend_changed
) {
384 xendev
->ops
->backend_changed(xendev
, node
);
389 static void xen_be_frontend_changed(struct XenDevice
*xendev
, const char *node
)
393 if (node
== NULL
|| strcmp(node
, "state") == 0) {
394 if (xenstore_read_fe_int(xendev
, "state", &fe_state
) == -1) {
395 fe_state
= XenbusStateUnknown
;
397 if (xendev
->fe_state
!= fe_state
) {
398 xen_be_printf(xendev
, 1, "frontend state: %s -> %s\n",
399 xenbus_strstate(xendev
->fe_state
),
400 xenbus_strstate(fe_state
));
402 xendev
->fe_state
= fe_state
;
404 if (node
== NULL
|| strcmp(node
, "protocol") == 0) {
405 g_free(xendev
->protocol
);
406 xendev
->protocol
= xenstore_read_fe_str(xendev
, "protocol");
407 if (xendev
->protocol
) {
408 xen_be_printf(xendev
, 1, "frontend protocol: %s\n", xendev
->protocol
);
413 xen_be_printf(xendev
, 2, "frontend update: %s\n", node
);
414 if (xendev
->ops
->frontend_changed
) {
415 xendev
->ops
->frontend_changed(xendev
, node
);
420 /* ------------------------------------------------------------- */
421 /* Check for possible state transitions and perform them. */
424 * Initial xendev setup. Read frontend path, register watch for it.
425 * Should succeed once xend finished setting up the backend device.
427 * Also sets initial state (-> Initializing) when done. Which
428 * only affects the xendev->be_state variable as xenbus should
429 * already be put into that state by xend.
431 static int xen_be_try_setup(struct XenDevice
*xendev
)
433 char token
[XEN_BUFSIZE
];
436 if (xenstore_read_be_int(xendev
, "state", &be_state
) == -1) {
437 xen_be_printf(xendev
, 0, "reading backend state failed\n");
441 if (be_state
!= XenbusStateInitialising
) {
442 xen_be_printf(xendev
, 0, "initial backend state is wrong (%s)\n",
443 xenbus_strstate(be_state
));
447 xendev
->fe
= xenstore_read_be_str(xendev
, "frontend");
448 if (xendev
->fe
== NULL
) {
449 xen_be_printf(xendev
, 0, "reading frontend path failed\n");
453 /* setup frontend watch */
454 snprintf(token
, sizeof(token
), "fe:%p", xendev
);
455 if (!xs_watch(xenstore
, xendev
->fe
, token
)) {
456 xen_be_printf(xendev
, 0, "watching frontend path (%s) failed\n",
460 xen_be_set_state(xendev
, XenbusStateInitialising
);
462 xen_be_backend_changed(xendev
, NULL
);
463 xen_be_frontend_changed(xendev
, NULL
);
468 * Try initialize xendev. Prepare everything the backend can do
469 * without synchronizing with the frontend. Fakes hotplug-status. No
470 * hotplug involved here because this is about userspace drivers, thus
471 * there are kernel backend devices which could invoke hotplug.
473 * Goes to InitWait on success.
475 static int xen_be_try_init(struct XenDevice
*xendev
)
479 if (!xendev
->online
) {
480 xen_be_printf(xendev
, 1, "not online\n");
484 if (xendev
->ops
->init
) {
485 rc
= xendev
->ops
->init(xendev
);
488 xen_be_printf(xendev
, 1, "init() failed\n");
492 xenstore_write_be_str(xendev
, "hotplug-status", "connected");
493 xen_be_set_state(xendev
, XenbusStateInitWait
);
498 * Try to initialise xendev. Depends on the frontend being ready
499 * for it (shared ring and evtchn info in xenstore, state being
500 * Initialised or Connected).
502 * Goes to Connected on success.
504 static int xen_be_try_initialise(struct XenDevice
*xendev
)
508 if (xendev
->fe_state
!= XenbusStateInitialised
&&
509 xendev
->fe_state
!= XenbusStateConnected
) {
510 if (xendev
->ops
->flags
& DEVOPS_FLAG_IGNORE_STATE
) {
511 xen_be_printf(xendev
, 2, "frontend not ready, ignoring\n");
513 xen_be_printf(xendev
, 2, "frontend not ready (yet)\n");
518 if (xendev
->ops
->initialise
) {
519 rc
= xendev
->ops
->initialise(xendev
);
522 xen_be_printf(xendev
, 0, "initialise() failed\n");
526 xen_be_set_state(xendev
, XenbusStateConnected
);
531 * Try to let xendev know that it is connected. Depends on the
532 * frontend being Connected. Note that this may be called more
533 * than once since the backend state is not modified.
535 static void xen_be_try_connected(struct XenDevice
*xendev
)
537 if (!xendev
->ops
->connected
) {
541 if (xendev
->fe_state
!= XenbusStateConnected
) {
542 if (xendev
->ops
->flags
& DEVOPS_FLAG_IGNORE_STATE
) {
543 xen_be_printf(xendev
, 2, "frontend not ready, ignoring\n");
545 xen_be_printf(xendev
, 2, "frontend not ready (yet)\n");
550 xendev
->ops
->connected(xendev
);
554 * Teardown connection.
556 * Goes to Closed when done.
558 static void xen_be_disconnect(struct XenDevice
*xendev
, enum xenbus_state state
)
560 if (xendev
->be_state
!= XenbusStateClosing
&&
561 xendev
->be_state
!= XenbusStateClosed
&&
562 xendev
->ops
->disconnect
) {
563 xendev
->ops
->disconnect(xendev
);
565 if (xendev
->be_state
!= state
) {
566 xen_be_set_state(xendev
, state
);
571 * Try to reset xendev, for reconnection by another frontend instance.
573 static int xen_be_try_reset(struct XenDevice
*xendev
)
575 if (xendev
->fe_state
!= XenbusStateInitialising
) {
579 xen_be_printf(xendev
, 1, "device reset (for re-connect)\n");
580 xen_be_set_state(xendev
, XenbusStateInitialising
);
585 * state change dispatcher function
587 void xen_be_check_state(struct XenDevice
*xendev
)
591 /* frontend may request shutdown from almost anywhere */
592 if (xendev
->fe_state
== XenbusStateClosing
||
593 xendev
->fe_state
== XenbusStateClosed
) {
594 xen_be_disconnect(xendev
, xendev
->fe_state
);
598 /* check for possible backend state transitions */
600 switch (xendev
->be_state
) {
601 case XenbusStateUnknown
:
602 rc
= xen_be_try_setup(xendev
);
604 case XenbusStateInitialising
:
605 rc
= xen_be_try_init(xendev
);
607 case XenbusStateInitWait
:
608 rc
= xen_be_try_initialise(xendev
);
610 case XenbusStateConnected
:
611 /* xendev->be_state doesn't change */
612 xen_be_try_connected(xendev
);
615 case XenbusStateClosed
:
616 rc
= xen_be_try_reset(xendev
);
627 /* ------------------------------------------------------------- */
629 static int xenstore_scan(const char *type
, int dom
, struct XenDevOps
*ops
)
631 struct XenDevice
*xendev
;
632 char path
[XEN_BUFSIZE
], token
[XEN_BUFSIZE
];
634 unsigned int cdev
, j
;
637 snprintf(token
, sizeof(token
), "be:%p:%d:%p", type
, dom
, ops
);
638 snprintf(path
, sizeof(path
), "backend/%s/%d", type
, dom
);
639 if (!xs_watch(xenstore
, path
, token
)) {
640 xen_be_printf(NULL
, 0, "xen be: watching backend path (%s) failed\n", path
);
644 /* look for backends */
645 dev
= xs_directory(xenstore
, 0, path
, &cdev
);
649 for (j
= 0; j
< cdev
; j
++) {
650 xendev
= xen_be_get_xendev(type
, dom
, atoi(dev
[j
]), ops
);
651 if (xendev
== NULL
) {
654 xen_be_check_state(xendev
);
660 static void xenstore_update_be(char *watch
, char *type
, int dom
,
661 struct XenDevOps
*ops
)
663 struct XenDevice
*xendev
;
664 char path
[XEN_BUFSIZE
], *bepath
;
665 unsigned int len
, dev
;
667 len
= snprintf(path
, sizeof(path
), "backend/%s/%d", type
, dom
);
668 if (strncmp(path
, watch
, len
) != 0) {
671 if (sscanf(watch
+len
, "/%u/%255s", &dev
, path
) != 2) {
673 if (sscanf(watch
+len
, "/%u", &dev
) != 1) {
681 xendev
= xen_be_get_xendev(type
, dom
, dev
, ops
);
682 if (xendev
!= NULL
) {
683 bepath
= xs_read(xenstore
, 0, xendev
->be
, &len
);
684 if (bepath
== NULL
) {
685 xen_be_del_xendev(dom
, dev
);
688 xen_be_backend_changed(xendev
, path
);
689 xen_be_check_state(xendev
);
694 static void xenstore_update_fe(char *watch
, struct XenDevice
*xendev
)
699 len
= strlen(xendev
->fe
);
700 if (strncmp(xendev
->fe
, watch
, len
) != 0) {
703 if (watch
[len
] != '/') {
706 node
= watch
+ len
+ 1;
708 xen_be_frontend_changed(xendev
, node
);
709 xen_be_check_state(xendev
);
712 static void xenstore_update(void *unused
)
715 intptr_t type
, ops
, ptr
;
716 unsigned int dom
, count
;
718 vec
= xs_read_watch(xenstore
, &count
);
723 if (sscanf(vec
[XS_WATCH_TOKEN
], "be:%" PRIxPTR
":%d:%" PRIxPTR
,
724 &type
, &dom
, &ops
) == 3) {
725 xenstore_update_be(vec
[XS_WATCH_PATH
], (void*)type
, dom
, (void*)ops
);
727 if (sscanf(vec
[XS_WATCH_TOKEN
], "fe:%" PRIxPTR
, &ptr
) == 1) {
728 xenstore_update_fe(vec
[XS_WATCH_PATH
], (void*)ptr
);
735 static void xen_be_evtchn_event(void *opaque
)
737 struct XenDevice
*xendev
= opaque
;
740 port
= xenevtchn_pending(xendev
->evtchndev
);
741 if (port
!= xendev
->local_port
) {
742 xen_be_printf(xendev
, 0,
743 "xenevtchn_pending returned %d (expected %d)\n",
744 port
, xendev
->local_port
);
747 xenevtchn_unmask(xendev
->evtchndev
, port
);
749 if (xendev
->ops
->event
) {
750 xendev
->ops
->event(xendev
);
754 /* -------------------------------------------------------------------- */
756 int xen_be_init(void)
758 xenstore
= xs_daemon_open();
760 xen_be_printf(NULL
, 0, "can't connect to xenstored\n");
764 qemu_set_fd_handler(xs_fileno(xenstore
), xenstore_update
, NULL
, NULL
);
766 if (xen_xc
== NULL
|| xen_fmem
== NULL
) {
767 /* Check if xen_init() have been called */
771 xen_sysdev
= qdev_create(NULL
, TYPE_XENSYSDEV
);
772 qdev_init_nofail(xen_sysdev
);
777 qemu_set_fd_handler(xs_fileno(xenstore
), NULL
, NULL
, NULL
);
778 xs_daemon_close(xenstore
);
784 int xen_be_register(const char *type
, struct XenDevOps
*ops
)
789 if (ops
->backend_register
) {
790 rc
= ops
->backend_register();
796 snprintf(path
, sizeof(path
), "device-model/%u/backends/%s", xen_domid
,
798 xenstore_mkdir(path
, XS_PERM_NONE
);
800 return xenstore_scan(type
, xen_domid
, ops
);
803 int xen_be_bind_evtchn(struct XenDevice
*xendev
)
805 if (xendev
->local_port
!= -1) {
808 xendev
->local_port
= xenevtchn_bind_interdomain
809 (xendev
->evtchndev
, xendev
->dom
, xendev
->remote_port
);
810 if (xendev
->local_port
== -1) {
811 xen_be_printf(xendev
, 0, "xenevtchn_bind_interdomain failed\n");
814 xen_be_printf(xendev
, 2, "bind evtchn port %d\n", xendev
->local_port
);
815 qemu_set_fd_handler(xenevtchn_fd(xendev
->evtchndev
),
816 xen_be_evtchn_event
, NULL
, xendev
);
820 void xen_be_unbind_evtchn(struct XenDevice
*xendev
)
822 if (xendev
->local_port
== -1) {
825 qemu_set_fd_handler(xenevtchn_fd(xendev
->evtchndev
), NULL
, NULL
, NULL
);
826 xenevtchn_unbind(xendev
->evtchndev
, xendev
->local_port
);
827 xen_be_printf(xendev
, 2, "unbind evtchn port %d\n", xendev
->local_port
);
828 xendev
->local_port
= -1;
831 int xen_be_send_notify(struct XenDevice
*xendev
)
833 return xenevtchn_notify(xendev
->evtchndev
, xendev
->local_port
);
838 * 0 == errors (stderr + logfile).
839 * 1 == informative debug messages (logfile only).
840 * 2 == noisy debug messages (logfile only).
841 * 3 == will flood your log (logfile only).
843 void xen_be_printf(struct XenDevice
*xendev
, int msg_level
, const char *fmt
, ...)
848 if (msg_level
> xendev
->debug
) {
851 qemu_log("xen be: %s: ", xendev
->name
);
852 if (msg_level
== 0) {
853 fprintf(stderr
, "xen be: %s: ", xendev
->name
);
856 if (msg_level
> debug
) {
859 qemu_log("xen be core: ");
860 if (msg_level
== 0) {
861 fprintf(stderr
, "xen be core: ");
865 qemu_log_vprintf(fmt
, args
);
867 if (msg_level
== 0) {
869 vfprintf(stderr
, fmt
, args
);
875 static int xen_sysdev_init(SysBusDevice
*dev
)
880 static Property xen_sysdev_properties
[] = {
881 {/* end of property list */},
884 static void xen_sysdev_class_init(ObjectClass
*klass
, void *data
)
886 DeviceClass
*dc
= DEVICE_CLASS(klass
);
887 SysBusDeviceClass
*k
= SYS_BUS_DEVICE_CLASS(klass
);
889 k
->init
= xen_sysdev_init
;
890 dc
->props
= xen_sysdev_properties
;
893 static const TypeInfo xensysdev_info
= {
894 .name
= TYPE_XENSYSDEV
,
895 .parent
= TYPE_SYS_BUS_DEVICE
,
896 .instance_size
= sizeof(SysBusDevice
),
897 .class_init
= xen_sysdev_class_init
,
900 static void xenbe_register_types(void)
902 type_register_static(&xensysdev_info
);
905 type_init(xenbe_register_types
);