From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbYYV-00024W-5y for qemu-devel@nongnu.org; Mon, 04 Jun 2012 10:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbYYO-0007Ql-ND for qemu-devel@nongnu.org; Mon, 04 Jun 2012 10:46:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbYYO-0007QI-ER for qemu-devel@nongnu.org; Mon, 04 Jun 2012 10:46:44 -0400 Message-ID: <4FCCCA23.3090009@redhat.com> Date: Mon, 04 Jun 2012 16:45:55 +0200 From: Kevin Wolf 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> In-Reply-To: <1338815410-24890-2-git-send-email-coreyb@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 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: Corey Bryant Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com 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