提交 a10348c3 编写于 作者: A Amit Shah 提交者: Anthony Liguori

virtio-console: no need to remove char handlers explicitly

qdev is now equipped (thanks to the last commit) to disassociate
chardevs from the qdev devices on the devices going away.  So doing it
in the virtio-console driver is not necessary.

Since that was the only thing being done in the qdev exit method, drop
it entirely.
Signed-off-by: NAmit Shah <amit.shah@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 a87f3e8b
......@@ -125,27 +125,11 @@ static int virtconsole_initfn(VirtIOSerialPort *port)
return 0;
}
static int virtconsole_exitfn(VirtIOSerialPort *port)
{
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
if (vcon->chr) {
/*
* Instead of closing the chardev, free it so it can be used
* for other purposes.
*/
qemu_chr_add_handlers(vcon->chr, NULL, NULL, NULL, NULL);
}
return 0;
}
static VirtIOSerialPortInfo virtconsole_info = {
.qdev.name = "virtconsole",
.qdev.size = sizeof(VirtConsole),
.is_console = true,
.init = virtconsole_initfn,
.exit = virtconsole_exitfn,
.have_data = flush_buf,
.guest_open = guest_open,
.guest_close = guest_close,
......@@ -165,7 +149,6 @@ static VirtIOSerialPortInfo virtserialport_info = {
.qdev.name = "virtserialport",
.qdev.size = sizeof(VirtConsole),
.init = virtconsole_initfn,
.exit = virtconsole_exitfn,
.have_data = flush_buf,
.guest_open = guest_open,
.guest_close = guest_close,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册