Devices that cannot be handled should not be closed, instead leave
them as is. This prevents closing the vkbd device, which has the
effect of making Qemu stop sending keys to the guest.

Tested with qemu-xen-traditional, qemu-xen and qemu stubdomains, all
working as expected.
---
 sys/xen/xenbus/xenbusb.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/sys/xen/xenbus/xenbusb.c b/sys/xen/xenbus/xenbusb.c
index 3e2d56f..8370195 100644
--- a/sys/xen/xenbus/xenbusb.c
+++ b/sys/xen/xenbus/xenbusb.c
@@ -418,6 +418,9 @@ xenbusb_probe_children(device_t dev)
        device_t *kids;
        struct xenbus_device_ivars *ivars;
        int i, count;
+       struct xenbusb_softc *xbs;
+
+       xbs = device_get_softc(dev);
 
        if (device_get_children(dev, &kids, &count) == 0) {
                for (i = 0; i < count; i++) {
@@ -430,7 +433,21 @@ xenbusb_probe_children(device_t dev)
                                continue;
                        }
 
-                       if (device_probe_and_attach(kids[i])) {
+                       if (device_probe(kids[i])) {
+                               /*
+                                * Don't mess the state of devices the kernel
+                                * cannot handle.
+                                */
+                               xenbusb_delete_child(dev, kids[i]);
+
+                               mtx_lock(&xbs->xbs_lock);
+                               xbs->xbs_connecting_children--;
+                               mtx_unlock(&xbs->xbs_lock);
+
+                               continue;
+                       }
+
+                       if (device_attach(kids[i])) {
                                /*
                                 * Transition device to the closed state
                                 * so the world knows that attachment will
-- 
1.7.7.5 (Apple Git-26)

_______________________________________________
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"

Reply via email to