Amit Shah b353a6b821 virtio: console: Add reference counting for port struct
When a port got hot-unplugged, when a port was open, any file operation
after the unplugging resulted in a crash. This is fixed by ref-counting
the port structure, and releasing it only when the file is closed.

This splits the unplug operation in two parts: first marks the port
as unavailable, removes all the buffers in the vqs and removes the port
from the per-device list of ports. The second stage, invoked when all
references drop to zero, releases the chardev and frees all other memory.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-10-21 17:44:03 +10:30
..
2009-09-24 07:21:03 -07:00
2010-08-16 23:44:49 -06:00
2008-12-13 11:25:49 -08:00
2008-10-20 08:52:41 -07:00
2010-08-10 13:47:40 -07:00
2008-07-20 17:12:36 -07:00
2010-05-17 03:06:12 +02:00
2010-08-10 13:47:40 -07:00
2010-08-12 08:43:29 -07:00
2009-12-10 22:55:36 +01:00
2008-02-07 08:42:25 -08:00
2008-04-30 08:29:43 -07:00
2010-08-10 13:47:45 -07:00
2010-08-10 13:47:43 -07:00
2010-08-10 13:47:39 -07:00
2010-08-11 08:59:23 -07:00
2010-05-27 09:12:50 -07:00
2010-08-18 08:35:47 -04:00
2010-05-27 09:12:50 -07:00
2010-08-10 13:47:40 -07:00
2008-07-20 17:12:38 -07:00
2010-08-23 18:17:21 -07:00
2009-02-22 09:23:02 -08:00
2010-08-10 13:47:44 -07:00
2008-07-20 17:12:38 -07:00
2010-08-10 13:47:40 -07:00
2010-08-10 13:47:43 -07:00
2009-10-14 17:36:53 +02:00
2010-01-04 12:31:21 -08:00
2010-08-10 13:47:44 -07:00