Re: passing FDs across domains

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

 



On 11/14/2017 09:02 AM, Gerd Hoffmann wrote:
On Mon, Nov 13, 2017 at 03:18:46PM +0100, Tomeu Vizoso wrote:
Hi,

I'm looking at what would be the best way for Wayland clients running in a
VM to communicate with a Wayland compositor in the host.

The base Wayland protocol is fairly self-contained, with little or no
references to objects outside the client and the server, so it lends itself
very well to virtualization.

But there's a problem when passing references to pixel buffers around with
FD passing, as SCM_RIGHTS isn't currently implemented in AF_VSOCK.

The Wayland project is willing to consider adding AF_VSOCK support to the
libwayland libraries alongside existing support for AF_UNIX, both on client
and server.

Any opinions on whether adding SCM_RIGHTS support to AF_VSOCK is a good
idea?

Not going to work.  A file handle is a reference to a kernel object
which can be pretty much anything (file, socket, timer, memory, ...) and
you can't pass that across machine borders.  It's not working for
AF_INET for the same reason.

The idea was to only allow passing FDs that point that objects that can be shared across domains. So shared memory buffers in this case.

Or other options for letting processes in the host to access shmem
buffers allocated within the guest?

Regarding the mechanics of mapping guest buffers in the host, I was hoping
the approach described below would work:

http://www.fp7-save.eu/papers/SCALCOM2016.pdf

Doesn't look that useful to me on a quick glance.

Lets step back and look at the problem you are trying to solve.

It seems you want guest wayland applications appear seamless on the host
wayland server, correct?

Correct.

How does the wayland rendering workflow look like?  As far I know the
wayland protocol doesn't include any rendering.  Rendering happens
client side, into some buffer (one per window), which is then passed to
the server for display compositing.  Correct?  So you basically want
pass that buffer from guest to host?

Correct.

What kind of shared memory is used by wayland?
sysv shm?  gbm buffers / dmabufs?

Typically, shared memory for CPU-rendered content, and dmabufs for GPU-rendered content.

Thanks,

Tomeu




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux