From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbZfP-00034z-69 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 11:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbZfK-0004cx-E5 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 11:58:02 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:39288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbZfK-0004be-7J for qemu-devel@nongnu.org; Mon, 04 Jun 2012 11:57:58 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Jun 2012 09:57:54 -0600 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id DD690C90060 for ; Mon, 4 Jun 2012 11:57:50 -0400 (EDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q54Fvoqg150052 for ; Mon, 4 Jun 2012 11:57:50 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q54Fvb1K025522 for ; Mon, 4 Jun 2012 09:57:37 -0600 Message-ID: <4FCCDAEF.5080504@linux.vnet.ibm.com> Date: Mon, 04 Jun 2012 11:57:35 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1338815410-24890-1-git-send-email-coreyb@linux.vnet.ibm.com> <1338815410-24890-2-git-send-email-coreyb@linux.vnet.ibm.com> <4FCCCA23.3090009@redhat.com> In-Reply-To: <4FCCCA23.3090009@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 06/04/2012 10:45 AM, Kevin Wolf wrote: > Am 04.06.2012 15:10, schrieb Corey Bryant: >> This patch adds QMP support for the getfd command using the QAPI framework. >> Like the HMP getfd command, it is used to pass a file descriptor via >> SCM_RIGHTS. However, the QMP getfd command also returns the received file >> descriptor, which is a difference in behavior from the HMP getfd command, >> which returns nothing. >> >> Signed-off-by: Corey Bryant >> --- >> hmp-commands.hx | 2 +- >> monitor.c | 37 ++++++++++++++++++++++++++++++++++++- >> qapi-schema.json | 13 +++++++++++++ >> qmp-commands.hx | 6 ++++-- >> 4 files changed, 54 insertions(+), 4 deletions(-) >> >> diff --git a/hmp-commands.hx b/hmp-commands.hx >> index 18cb415..dfab369 100644 >> --- a/hmp-commands.hx >> +++ b/hmp-commands.hx >> @@ -1211,7 +1211,7 @@ ETEXI >> .params = "getfd name", >> .help = "receive a file descriptor via SCM rights and assign it a name", >> .user_print = monitor_user_noop, >> - .mhandler.cmd_new = do_getfd, >> + .mhandler.cmd_new = hmp_getfd, >> }, >> >> STEXI >> diff --git a/monitor.c b/monitor.c >> index 12a6fe2..6acf5a3 100644 >> --- a/monitor.c >> +++ b/monitor.c >> @@ -2199,7 +2199,7 @@ static void do_inject_mce(Monitor *mon, const QDict *qdict) >> } >> #endif >> >> -static int do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data) >> +static int hmp_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data) >> { >> const char *fdname = qdict_get_str(qdict, "fdname"); >> mon_fd_t *monfd; > > This should become a wrapper around qmp_getfd() instead of duplicating > the logic. > > Kevin > Yes, I was thinking about that. I'll do this in v2. -- Regards, Corey