Skip to contentSkip to conversation

Paravirt framebuffer not-used fixes [5/6]

PATCH New Jeremy Katz 1 participant 1 message Aug 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Paravirt framebuffer not-used fixes [5/6]

Don't initialize xenfb or xenkbd in dom0 or if our domain isn't set up to use a graphical console

Jeremy

linux-2.6-xen-sparse/drivers/xen/xenfb/xenfb.c +9 -0
diff -r d49bc30b6b27 -r e1df81251b97 linux-2.6-xen-sparse/drivers/xen/xenfb/xenfb.c
@@ -369,6 +369,15 @@ static int __init xenfb_probe(void)
 	struct fb_info *fb_info;
 	struct evtchn_alloc_unbound alloc_unbound;
 	struct xenbus_transaction xbt;
+
+        /* Nothing to do if running in dom0. */
+        if (is_initial_xendomain())
+	  return -ENODEV;
+        /* if we're not set up to use graphics mode, then don't initialize */
+	if (xenbus_scanf(XBT_NIL, "console", "use_graphics", "%d", &ret) < 0)
+	  return -ENODEV;
+	if (ret == 0)
+	  return -ENODEV;
 
 	info = kmalloc(sizeof(*info), GFP_KERNEL);
 	if (info == NULL)
linux-2.6-xen-sparse/drivers/xen/xenkbd/xenkbd.c +9 -0
diff -r d49bc30b6b27 -r e1df81251b97 linux-2.6-xen-sparse/drivers/xen/xenkbd/xenkbd.c
@@ -80,6 +80,15 @@ int __init xenkbd_init(void)
 	struct input_dev *input_dev;
 	struct evtchn_alloc_unbound alloc_unbound;
 	struct xenbus_transaction xbt;
+
+        /* Nothing to do if running in dom0. */
+        if (is_initial_xendomain())
+	  return -ENODEV;
+        /* if we're not set up to use graphics mode, then don't initialize */
+	if (xenbus_scanf(XBT_NIL, "console", "use_graphics", "%d", &ret) < 0)
+	  return -ENODEV;
+	if (ret == 0)
+	  return -ENODEV;
 
 	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
 	input_dev = input_allocate_device();

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel