From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeB9o-00065V-HH for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:10:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeB9j-00061K-On for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:10:35 -0400 Received: from [199.232.76.173] (port=46321 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeB9j-000611-FP for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:10:31 -0400 Received: from mail2.shareable.org ([80.68.89.115]:51040) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeB9j-0001vv-1P for qemu-devel@nongnu.org; Thu, 20 Aug 2009 13:10:31 -0400 Date: Thu, 20 Aug 2009 18:10:18 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication Message-ID: <20090820171018.GA2370@shareable.org> References: <20090806173740.GA1178@shareable.org> <4A856B5E.2000303@redhat.com> <4A858FFC.7000607@codemonkey.ws> <200908201701.30467.rusty@rustcorp.com.au> <4A8CFEDD.4000009@redhat.com> <20090820075539.GA5876@amit-x200.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090820075539.GA5876@amit-x200.redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Rusty Russell , virtualization@lists.linux-foundation.org, Gerd Hoffmann , kvm@vger.kernel.org, qemu-devel@nongnu.org Amit Shah wrote: > > 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. How would a third party go about assigning themselves a number? For the sake of example, imagine they develop a simple service like "guesttop" which let's the host get a listing of guest processes. They'll have to distributed app-specific udev rule patches for every guest distro, which sounds like a lot of work. The app itself is probably a very simple C program; the hardest part of making it portable across distros would be the udev rules, which is silly. Anyway, every other device has a name or uuid these days. You can still use /dev/sda1 to refer to your boot partition, but LABEL=boot is also available if you prefer. Isn't that the ethos these days? Why not both? /dev/vmch05 if you prefer, plus symlink /dev/vmch-guesttop -> /dev/vmch05 if name=guesttop was given to QEMU. If you do stay with numbers only, note that it's not like TCP/UDP port numbers because the number space is far smaller. Picking a random number that you hope nobody else uses is harder. ... Back to technical bits. If config space is tight, use a channel! Dedicate channel 0 to control, used to fetch the name (if there is one) for each number. -- Jamie