From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWGDE-0004ci-VN for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:52:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWGDD-0004br-F4 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:52:52 -0400 Received: from [199.232.76.173] (port=36510 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWGDD-0004bi-7A for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:52:51 -0400 Received: from mx1.redhat.com ([66.187.233.31]:59880) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KWGDD-0002K3-95 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:52:51 -0400 Date: Thu, 21 Aug 2008 20:52:40 +0100 From: "Daniel P. Berrange" Subject: Re: [Xen-devel] Re: [Qemu-devel] vnc port selection Message-ID: <20080821195240.GA1531@redhat.com> References: <48AD99CF.6070004@redhat.com> <48ADB43D.9050401@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48ADB43D.9050401@qumranet.com> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Xen Development Mailing List , qemu-devel@nongnu.org On Thu, Aug 21, 2008 at 09:30:21PM +0300, Avi Kivity wrote: > Gerd Hoffmann wrote: > > Hi folks, > > > >Xen's qemu-dm version has a '-vncunused' command line switch which asks > >the internal vnc server to pick any unused tcp port to listen on. The > >actual port is communicated to the outside world via xenstore. > > > >I'm looking for a reasonable way to implement that functionality in > >upstream qemu. First, I think it shouldn't be a separate command line > >switch but an option for the existion -vnc switch. Second, we need a > >way to communicate the port picked which isn't xen-specific. Obvious > >choice is a monitor info subcommand. > > > >Comments? Other suggestions? > > > > > > Presumably -vncunused is passed by the management application, which > knows about all domains. Can't it figure out an unused port and pass it on? > Yes & no. Yes, we do this in libvirt, but it open a race condition unless you pass the actual file descriptor to QEMU. In addition when we add IPv6 support to QEMU, you will actally have multiple sockets you need to listen on. It will make it far easier if we just do the right thing in QEMU, based on a command line flag. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|