Patchwork [v2,2/2] virtio-console: no need to remove char handlers explicitly

login
register
mail settings
Submitter Amit Shah
Date Jan. 13, 2012, 9:59 a.m.
Message ID <bf3d52fdcc0c8f4c66da140314aacfb794ca0b08.1326448718.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/135776/
State New
Headers show

Comments

Amit Shah - Jan. 13, 2012, 9:59 a.m.
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>
---
 hw/virtio-console.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)

Patch

diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 73d866a..0b28a30 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -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,