From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication Date: Thu, 20 Aug 2009 18:10:18 +0100 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 Cc: Gerd Hoffmann , Rusty Russell , qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: Amit Shah Return-path: Received: from mail2.shareable.org ([80.68.89.115]:59861 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754843AbZHTRKa (ORCPT ); Thu, 20 Aug 2009 13:10:30 -0400 Content-Disposition: inline In-Reply-To: <20090820075539.GA5876@amit-x200.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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