From patchwork Tue Dec 20 16:51:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 132487 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 27C0EB6FCA for ; Wed, 21 Dec 2011 05:14:01 +1100 (EST) Received: from localhost ([::1]:44618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd4CM-0000Gi-Gb for incoming@patchwork.ozlabs.org; Tue, 20 Dec 2011 13:13:58 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2w1-0007oG-Da for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:53:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rd2vu-0006aM-WE for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:53:01 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:41705 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2vu-0006aD-PY for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:52:54 -0500 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id pBKGqqvT022025; Tue, 20 Dec 2011 10:52:53 -0600 Received: (from anthony@localhost) by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id pBKGqpQd022023; Tue, 20 Dec 2011 10:52:51 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Tue, 20 Dec 2011 10:51:51 -0600 Message-Id: <1324399916-21315-23-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> References: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 70.123.132.139 Cc: Amit Shah , Paolo Bonzini , Anthony Liguori , Markus Armbruster Subject: [Qemu-devel] [PATCH 22/27] not-for-upstream: virtio-serial: stub out a strange hack 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 You shouldn't override class methods in an object initialization function. Whatever the code is trying to achieve here, it needs to be rethought and done in a better way. Amit, if you can give me some insight into what's going on here, I can take a look at refactoring. Cc: Amit Shah --- hw/virtio-console.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/virtio-console.c b/hw/virtio-console.c index f922400..6c32e7f 100644 --- a/hw/virtio-console.c +++ b/hw/virtio-console.c @@ -109,9 +109,13 @@ static int virtconsole_initfn(VirtIOSerialPort *port) if (vcon->chr) { qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event, vcon); - info->have_data = flush_buf; - info->guest_open = guest_open; - info->guest_close = guest_close; + /* FIXME: This is not right */ + abort(); + if (0) { + info->have_data = flush_buf; + info->guest_open = guest_open; + info->guest_close = guest_close; + } } return 0;