qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 9/9] vhost-vdpa: allow pre-opend file descriptor


From: Eric Blake
Subject: Re: [PATCH 9/9] vhost-vdpa: allow pre-opend file descriptor
Date: Wed, 16 Sep 2020 11:04:17 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 8/31/20 6:16 AM, Cindy Lu wrote:
On Mon, 31 Aug 2020 at 16:30, Jason Wang <jasowang@redhat.com> 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 <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---

+++ 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

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