xen_console: ignore console disconnect events from console/0
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 27 Mar 2012 16:02:21 +0000 (16:02 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 27 Mar 2012 16:05:15 +0000 (16:05 +0000)
The first console has a different location compared to other PV devices
(console, rather than device/console/0) and doesn't obey the xenstore
state protocol. We already special case the first console in con_init
and con_initialise, we should also do it in con_disconnect.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/xen_console.c

index edcb31ce6629c0a74e7a9ae911dec5b57fa50a5c..3794b1972de5fbeb1c0162a89bcf57b80e555e1a 100644 (file)
@@ -248,6 +248,9 @@ static void con_disconnect(struct XenDevice *xendev)
 {
     struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
 
+    if (!xendev->dev) {
+        return;
+    }
     if (con->chr)
         qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
     xen_be_unbind_evtchn(&con->xendev);