From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqQNX-00071l-3e for qemu-devel@nongnu.org; Wed, 23 Sep 2009 07:51:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqQNR-0006yg-46 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 07:51:21 -0400 Received: from [199.232.76.173] (port=35462 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqQNQ-0006yV-Mf for qemu-devel@nongnu.org; Wed, 23 Sep 2009 07:51:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5921) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqQNQ-0008R0-4D for qemu-devel@nongnu.org; Wed, 23 Sep 2009 07:51:16 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8NBpFb5003864 for ; Wed, 23 Sep 2009 07:51:15 -0400 Date: Wed, 23 Sep 2009 17:20:43 +0530 From: Amit Shah Subject: Re: [Qemu-devel] [PATCH 3/4] virtio-console: Add support for multiple ports for generic guest-host communication Message-ID: <20090923115043.GA28088@amit-x200.redhat.com> References: <1253636627-12746-1-git-send-email-amit.shah@redhat.com> <1253636627-12746-2-git-send-email-amit.shah@redhat.com> <1253636627-12746-3-git-send-email-amit.shah@redhat.com> <1253636627-12746-4-git-send-email-amit.shah@redhat.com> <4AB9E536.4050001@redhat.com> <20090923094340.GA27483@amit-x200.redhat.com> <4ABA0481.6090603@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ABA0481.6090603@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On (Wed) Sep 23 2009 [13:20:33], Gerd Hoffmann wrote: > >>>> + char *name; >>>> + >>>> + QTAILQ_HEAD(, VirtIOConsolePortBuffer) unflushed_buffer_head; >>>> + >>>> + bool guest_connected; >>>> + bool host_connected; >>>> +}; >>> >>> Sticking a pointer to VirtConPortDeviceInfo here is probably handy. >>> More consistent naming please. >> >> Consistent naming for what? > > The structs. Pick a prefix (say VirtCon) and stick with that. Then for > the bus implementation: > > VirtConBus (fine) > VirtConPort (VirtIOConsolePort now) > VirtConPortInfo (VirtConPortDeviceInfo now) Yeah; I've not renamed the structs yet. > The console port driver could name its state info this way: > > VirtConPortConsole (doesn't exist right now it seems ...). You're actually suggesting to split everything -- a console (in the current sense) is a different device and a port (the new vmchannels) are different devices. Right? >>> You should be able to move the port driver(s) to a separate source file >>> without much trouble. Only the port driver should deal with a chardev. >> >> Oh OK; maybe I understand what you're saying about the chardevs now. >> >>> The virtio-console core should not care at all how the data is piped to >>> the (host side) users. It just drives the ring, forwards events, >>> accepts data for the guest (via helper function), passes on data from >>> the guest (via callback in VirtConPortDeviceInfo). >> >> Hm, let me think over this. > > A port driver should look roughly like the attached one. That one does > something completely different: Implement a watchdog ;) Warning: > didn't even compile it. > > The console port driver would have the chardev instead of the timer in > the driver state struct and would basically forward the data between the > port and the chardev. Thanks; parsing all this.. Amit