From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWpvp-0001uy-Aa for qemu-devel@nongnu.org; Tue, 22 May 2012 10:19:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWpvi-00020F-O1 for qemu-devel@nongnu.org; Tue, 22 May 2012 10:19:24 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:50679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWpvi-0001yW-Ge for qemu-devel@nongnu.org; Tue, 22 May 2012 10:19:18 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2012 08:19:13 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 5F75E19D8050 for ; Tue, 22 May 2012 08:18:46 -0600 (MDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4MEIvsJ138152 for ; Tue, 22 May 2012 08:18:57 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4MEHPd4028292 for ; Tue, 22 May 2012 08:17:48 -0600 Message-ID: <4FBB9F08.4060501@linux.vnet.ibm.com> Date: Tue, 22 May 2012 10:13:28 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1337631598-30639-1-git-send-email-coreyb@linux.vnet.ibm.com> <1337631598-30639-3-git-send-email-coreyb@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 2/4] qmp/hmp: Add getfd_file monitor command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino , eblake@redhat.com On 05/22/2012 05:18 AM, Stefan Hajnoczi wrote: > On Mon, May 21, 2012 at 9:19 PM, Corey Bryant wrote: > I think Eric has raised the main questions about duplicating getfd and > rules regarding canonical file names (QEMU mashes filenames together > if the backing filename is relative!). > Ok, good so it sounds like we this covered in the other threads then. >> + if (qemu_isdigit(filename[0])) { >> + qerror_report(QERR_INVALID_PARAMETER_VALUE, "filename", >> + "a name not starting with a digit"); >> + return -1; >> + } > > What is the reason for this filename restriction? > The reason is that I copied this from 'getfd'. :) I'll remove it. >> diff --git a/qmp-commands.hx b/qmp-commands.hx >> index db980fa..1825a91 100644 >> --- a/qmp-commands.hx >> +++ b/qmp-commands.hx >> @@ -891,6 +891,36 @@ Example: >> EQMP >> >> { >> + .name = "getfd_file", >> + .args_type = "filename:s", >> + .params = "getfd_file filename", >> + .help = "receive a file descriptor via SCM rights and assign it a filename", >> + .user_print = monitor_user_noop, >> + .mhandler.cmd_new = do_getfd_file, >> + }, >> + >> + >> +SQMP >> + >> +getfd_file >> +-------------- >> + >> +Receive a file descriptor via SCM rights and assign it a filename. >> + >> +Arguments: >> + >> +- "filename": filename (json-string) >> + >> +Example: >> + >> +-> { "execute": "getfd_file", >> + "arguments": { "filename": "/var/lib/libvirt/images/tst.img" } } >> +<- { "return": {} } >> + >> + >> +EQMP > > QMP commands should be added to qapi-schema.json as described in > docs/writing-qmp-commands.txt. > > Stefan > Ok thanks! -- Regards, Corey