From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRjAi-0001ON-S7 for qemu-devel@nongnu.org; Mon, 04 Jan 2010 04:24:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRjAd-0001M1-HD for qemu-devel@nongnu.org; Mon, 04 Jan 2010 04:24:20 -0500 Received: from [199.232.76.173] (port=39449 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRjAd-0001Lx-BQ for qemu-devel@nongnu.org; Mon, 04 Jan 2010 04:24:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38904) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRjAd-00058j-7O for qemu-devel@nongnu.org; Mon, 04 Jan 2010 04:24:15 -0500 Message-ID: <4B41B3A6.6090402@redhat.com> Date: Mon, 04 Jan 2010 10:23:50 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/3] virtio-console: Add a virtio-serial bus, support for multiple devices and ports References: <1261504146-26018-1-git-send-email-amit.shah@redhat.com> <1261504146-26018-2-git-send-email-amit.shah@redhat.com> <1261504146-26018-3-git-send-email-amit.shah@redhat.com> <20091223150732.GA15932@amit-x200.redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Amit Shah , qemu-devel@nongnu.org, agraf@suse.de Hi, >>>> @@ -321,13 +321,9 @@ void qdev_machine_creation_done(void) >>>> CharDriverState *qdev_init_chardev(DeviceState *dev) >>>> { >>>> static int next_serial; >>>> - static int next_virtconsole; >>>> + >>>> /* FIXME: This is a nasty hack that needs to go away. */ >>>> - if (strncmp(dev->info->name, "virtio", 6) == 0) { >>>> - return virtcon_hds[next_virtconsole++]; >>>> - } else { >>>> - return serial_hds[next_serial++]; >>>> - } >>>> + return serial_hds[next_serial++]; >>>> } >>> >>> I believe the FIXME is about the nasty special case for "virtio". Since >>> you fix that, better remove the FIXME. >> >> I did that in a previous submission and Gerd asked me to keep it. Even >> the serial init can be changed, I guess. > > Okay, Gerd's the authority on this. Yes, serial drivers should use a chardev property instead of qdev_init_chardev(). You can try to zap this function altogether, but I think there are still serial drivers using this so this would break the (full, all archs) build. cheers, Gerd