From patchwork Fri Jan 13 09:59:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 135776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 71583B6EE6 for ; Fri, 13 Jan 2012 21:18:02 +1100 (EST) Received: from localhost ([::1]:40332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rldw3-00051O-Vp for incoming@patchwork.ozlabs.org; Fri, 13 Jan 2012 05:00:35 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rldvf-0004Vb-Hi for qemu-devel@nongnu.org; Fri, 13 Jan 2012 05:00:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RldvZ-000257-JJ for qemu-devel@nongnu.org; Fri, 13 Jan 2012 05:00:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RldvZ-00024q-8S for qemu-devel@nongnu.org; Fri, 13 Jan 2012 05:00:05 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0DA03dK012374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Jan 2012 05:00:03 -0500 Received: from localhost (ovpn-113-56.phx2.redhat.com [10.3.113.56]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0DA00wD027322; Fri, 13 Jan 2012 05:00:02 -0500 From: Amit Shah To: qemu list Date: Fri, 13 Jan 2012 15:29:48 +0530 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Amit Shah , Gerd Hoffmann , Markus Armbruster Subject: [Qemu-devel] [PATCH v2 2/2] virtio-console: no need to remove char handlers explicitly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 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,