qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns fd
Date: Mon, 04 Jun 2012 16:45:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

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 <address@hidden>
> ---
>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]