From bebbd9162a12463b7e9bcd94793e28a1dc6bf4ef Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Tue, 24 Jan 2012 07:40:54 +0100
Subject: [PATCH 3/3] virtio-console: no need to remove char handlers
 explicitly

RH-Author: Amit Shah <amit.shah@redhat.com>
Message-id: <934e24e8c990ce3e130320547837ea5e5161c646.1327390706.git.amit.shah@redhat.com>
Patchwork-id: 36774
O-Subject: [RHEL6.3 qemu-kvm PATCH 2/2] virtio-console: no need to remove char handlers explicitly
Bugzilla: 770512
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>

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>
(cherry picked from commit a10348c3ad3a1bff7c5ace95a32187780d571ebd)

Conflicts:

	hw/virtio-console.c

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-console.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/virtio-console.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 1545e06..a2e9bf0 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -146,27 +146,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);
-    }
-
-    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,
@@ -186,7 +170,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,
-- 
1.7.7.5

