From bebbd9162a12463b7e9bcd94793e28a1dc6bf4ef Mon Sep 17 00:00:00 2001 From: Amit Shah 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 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 RH-Acked-by: Paolo Bonzini RH-Acked-by: Markus Armbruster 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 Signed-off-by: Anthony Liguori (cherry picked from commit a10348c3ad3a1bff7c5ace95a32187780d571ebd) Conflicts: hw/virtio-console.c Signed-off-by: Amit Shah --- hw/virtio-console.c | 17 ----------------- 1 files changed, 0 insertions(+), 17 deletions(-) Signed-off-by: Michal Novotny --- 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