From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48462 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGaJf-0002ob-AJ for qemu-devel@nongnu.org; Thu, 11 Nov 2010 11:48:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGaJe-0003De-3m for qemu-devel@nongnu.org; Thu, 11 Nov 2010 11:48:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGaJd-0003DT-NP for qemu-devel@nongnu.org; Thu, 11 Nov 2010 11:48:02 -0500 Date: Thu, 11 Nov 2010 14:47:55 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH 2/3] QMP: Introduce Human Monitor passthrough command Message-ID: <20101111144755.6d908877@doriath> In-Reply-To: <20101111163952.GN22152@redhat.com> References: <1288362514-31407-1-git-send-email-lcapitulino@redhat.com> <1288362514-31407-3-git-send-email-lcapitulino@redhat.com> <20101110113637.05d5a202@doriath> <20101111155555.GM22152@redhat.com> <4CDC1A37.9020306@codemonkey.ws> <20101111163952.GN22152@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: aliguori@us.ibm.com, Markus Armbruster , qemu-devel@nongnu.org On Thu, 11 Nov 2010 16:39:52 +0000 "Daniel P. Berrange" wrote: > On Thu, Nov 11, 2010 at 10:30:47AM -0600, Anthony Liguori wrote: > > On 11/11/2010 09:55 AM, Daniel P. Berrange wrote: > > >On Thu, Nov 11, 2010 at 04:47:41PM +0100, Markus Armbruster wrote: > > >>>>> 3. Query Commands > > >>>>> ================= > > >>>>> > > >>>>In the real human monitor, cpu-index is state (Monitor member mon_cpu). > > >>>>For pass through, you shift that state into the client (argument > > >>>>cpu-index). Is there any other state that could need shifting? You > > >>>>mention getfd. > > >>>> > > >>>Surprisingly or not, this is a very important question for QMP itself. > > >>> > > >>>Anthony has said that we should make it stateless, and I do think this > > >>>is good because it seems to simplify things considerably. > > >>> > > >>>However, I haven't thought about how to make things like getfd stateless. > > >>> > > >>Hmm, that sounds like we should investigate the getfd problem sooner > > >>rather than later. > > >> > > >The SCM_RIGHTS code allows you to send/receive multiple file handles in a > > >single sendmsg/recvmsg call. So why don't we just allow sending of the > > >file handles with the monitor command that actually needs them, instead of > > >ahead of time using send_fd. This simplifies life for the client because > > >they also don't have to worry about cleanup using close_fd if the command > > >using the FD fails. > > > > How do we identify file descriptors and then map them to a command? > > IIUC, the FDs sent/received via struct cmsghdr are in a strictly > ordered array, so why not just define a placeholder syntax for > the commands that maps to the array indexes. eg > > netdev_add tap,fd=$0,vhost_fd=$1,id=hostnet0 > > The '$' sign is not valid for a normal FD number, so use of a $0, > $1, $2, etc can reliably be substituted with the real FD number from > the cmsghdr array elements 0, 1, 2, etc I have the impression that the real problem is that they are being stored in the wrong place (ie. the monitor), *maybe* they should be stored somewhere else, ie. a special chardev or something. Today those fds are linked to a given monitor session..