On 8/31/20 6:16 AM, Cindy Lu wrote:
On Mon, 31 Aug 2020 at 16:30, Jason Wang <[email protected]> wrote:

This patch allows to initialize vhost-vdpa network backend with pre
opened vhost-vdpa file descriptor. This is useful for running
unprivileged qemu through libvirt.

Cc: Eric Blake <[email protected]>
Cc: Markus Armbruster <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
---

+++ b/qapi/net.json
@@ -442,12 +442,15 @@
  # @queues: number of queues to be created for multiqueue vhost-vdpa
  #          (default: 1)
  #
+# @fd: file descriptor of an already opened vhost-vdpa (since 5.2)
+#
  # Since: 5.1
  ##
  { 'struct': 'NetdevVhostVDPAOptions',
    'data': {
      '*vhostdev':     'str',
-    '*queues':       'int' } }
+    '*queues':       'int',
+    '*fd':           'str' } }

  ##
  # @NetClientDriver:
--
2.20.1

I think the latest  code supported this part.
you can pass a pre open file descriptor to it via the add-fd QMP
command to /dev/fdset/NNN, and then pass the string
"/dev/fdset/NNN" as vhostdev.  so we don't need a special fd parameter here.

Correct - the 'vhostdev' parameter + magic filename is all the more that is needed to access a pre-opened fd, so no 'fd' parameter should be added.

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


Reply via email to