virtio: console: Send SIGIO in case of port unplug
Amit Shah [Thu, 2 Sep 2010 13:17:54 +0000 (18:17 +0530)]
If a port has registered for SIGIO signals, let the application
know that the port is getting unplugged.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

drivers/char/virtio_console.c

index 6d5c579..dc42d56 100644 (file)
@@ -1259,6 +1259,9 @@ static void unplug_port(struct port *port)
                port->guest_connected = false;
                port->host_connected = false;
                wake_up_interruptible(&port->waitqueue);
+
+               /* Let the app know the port is going down. */
+               send_sigio_to_port(port);
        }
 
        if (is_console_port(port)) {