Skip to content

Commit

Permalink
virtio-console: no need to remove char handlers explicitly
Browse files Browse the repository at this point in the history
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: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
Amit Shah authored and Anthony Liguori committed Jan 13, 2012
1 parent a87f3e8 commit a10348c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions hw/virtio-console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit a10348c

Please sign in to comment.