qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org, armbru@redhat.com, thuth@redhat.com,
	quintela@redhat.com
Subject: Re: [PATCH 1/2] qmp: Add 'openfd' command
Date: Thu, 11 Jun 2020 09:34:39 -0500	[thread overview]
Message-ID: <c436ff28-fc42-5ed2-c152-39f06592298c@redhat.com> (raw)
In-Reply-To: <20200611111703.159590-2-dgilbert@redhat.com>

On 6/11/20 6:17 AM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> The existing 'getfd' command imports an fd from the monitor via
> SCM rights.
> This command allows qemu to open the file for itself; this is convenient
> primarily in testing, or with simple QMP clients.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>   monitor/misc.c | 48 ++++++++++++++++++++++++++++++++++++++----------
>   qapi/misc.json | 23 ++++++++++++++++++++++-
>   2 files changed, 60 insertions(+), 11 deletions(-)
> 

> +++ b/qapi/misc.json
> @@ -952,7 +952,7 @@
>   ##
>   # @closefd:
>   #
> -# Close a file descriptor previously passed via SCM rights
> +# Close a named file descriptor
>   #
>   # @fdname: file descriptor name
>   #
> @@ -968,6 +968,27 @@
>   ##
>   { 'command': 'closefd', 'data': {'fdname': 'str'} }
>   
> +##
> +# @openfd:
> +#
> +# Open a file descriptor.  The file is opened read-write.

Should this mention that this is shorthand for opening the file 
externally then using getfd on that fd?  And if we add that 
cross-reference, should we add the reverse reference in the docs for getfd?

> +#
> +# @fdname: file descriptor name
> +# @filename: file name
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 5.1
> +#
> +# Example:
> +#
> +# -> { "execute": "openfd", "arguments": { "fdname": "null",
> +#                                          "filename": "/dev/null" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'openfd', 'data': {'fdname': 'str', 'filename': 'str'} }
> +
>   ##
>   # @MemoryInfo:
>   #
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2020-06-11 14:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 11:17 [PATCH 0/2] monitor openfd commands Dr. David Alan Gilbert (git)
2020-06-11 11:17 ` [PATCH 1/2] qmp: Add 'openfd' command Dr. David Alan Gilbert (git)
2020-06-11 14:34   ` Eric Blake [this message]
2020-06-11 11:17 ` [PATCH 2/2] hmp: " Dr. David Alan Gilbert (git)
2020-06-11 14:31 ` [PATCH 0/2] monitor openfd commands Eric Blake
2020-06-11 16:45   ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c436ff28-fc42-5ed2-c152-39f06592298c@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).