From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Me2VG-0000H4-3P for qemu-devel@nongnu.org; Thu, 20 Aug 2009 03:56:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Me2VB-0000El-3O for qemu-devel@nongnu.org; Thu, 20 Aug 2009 03:56:09 -0400 Received: from [199.232.76.173] (port=34787 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Me2VA-0000Ed-RI for qemu-devel@nongnu.org; Thu, 20 Aug 2009 03:56:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3908) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Me2V9-0003N3-80 for qemu-devel@nongnu.org; Thu, 20 Aug 2009 03:56:03 -0400 Date: Thu, 20 Aug 2009 13:25:39 +0530 From: Amit Shah Subject: Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication Message-ID: <20090820075539.GA5876@amit-x200.redhat.com> References: <20090806173740.GA1178@shareable.org> <4A856B5E.2000303@redhat.com> <4A858FFC.7000607@codemonkey.ws> <200908201701.30467.rusty@rustcorp.com.au> <4A8CFEDD.4000009@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8CFEDD.4000009@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Rusty Russell , qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org On (Thu) Aug 20 2009 [09:44:29], Gerd Hoffmann wrote: > On 08/20/09 09:31, Rusty Russell wrote: >> On Sat, 15 Aug 2009 01:55:32 am Anthony Liguori wrote: >>> Gerd Hoffmann wrote: >>>> Also I still think passing a 'protocol' string for each port is a good >>>> idea, so you can stick that into a sysfs file for guests use. >>> Or drops ports altogether and just use protocol strings... >> >> Both is silly, yes. >> >> I guess strings + HAL magic can make the /dev names sane. I don't want to >> see userspace trolling through sysfs to figure out what device to open. > > udev can create sane /dev names (or symlinks) by checking sysfs > attributes, apps just open the /dev/whatever then. There still will have to be some way in transferring all the strings from qemu to the guest. Could be done from the config space, but will have to be done one port at a time (config space is limited in size). >> Which is why I prefer assigned numbers, which get mapped to minors. > > ports map trivially to minors. When using protocol strings minors can > simply be dynamically auto-allocated by the guest and we don't need the > port numbers in the host<->guest protocol any more. > > I think strings are better as numbers for identifying protocols as you > can work without a central registry for the numbers then. I like the way assigned numbers work: it's simpler to code, needs a bitmap for all the ports that fits in nicely in the config space and udev rules / scripts can point /dev/vmch02 to /dev/console. Amit