qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] qmp: Add 'openfd' command


From: Eric Blake
Subject: Re: [PATCH 1/2] qmp: Add 'openfd' command
Date: Thu, 11 Jun 2020 09:34:39 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

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 via email to

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