]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
[Wayland Copy & Paste] Part1: Add notification mechanism to the VMBlock module
authorOliver Kurth <okurth@vmware.com>
Tue, 5 Jun 2018 22:45:05 +0000 (15:45 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 5 Jun 2018 22:45:05 +0000 (15:45 -0700)
commit8532fc18fe4acbb3f1df354fa3f94bf7d4581adc
tree71d1840af5a4edc00d295813f6e39f72a190c1f7
parentf240e2095c0780eb4e8afa4a75d7cbb83c7f4185
[Wayland Copy & Paste] Part1: Add notification mechanism to the VMBlock module

This patch is part of the new feature for Workstation 15: [P0] Wayland support
in Linux guest - Copy & Paste.

In the implementation of current VMTools, there is a restriction, in the first
second after grab into the guest, the CopyPasteUIX11::LocalGetFileRequestCB,
which is a callback from a file paste request from another guest application
and begins copying the files from host to guest and return the file list,
will return none directly.

The Wayland file explorer will request the content in the clipboard after the
user clicks on the file explorer, and the request will get nothing since the
restriction in the VMTools, so the following ‘Paste’ operation will fail.

Solution:
This solution is only used for the Linux guest with Wayland. The behavior
for Linux guest with X11 will not change.

The restriction, the CopyPasteUIX11::LocalGetFileRequestCB returns directly
in the first second after grab into the guest, will be removed.

And, the notification mechanism will be added into the VM block file system.
This mechanism is similar with the inotify module.

Take the VMBlock Fuse File System as an example, currently, the mount point contains below contents:

* /blockdir/

* /dev

/blockdir/ contains the symlinks to the contents of the target directory.

/dev is the control file for VMBlock Fuse File System.

In this new solution, a new folder /notifydir/ will be added, each file in this folder is a special file, read from this file will be blocked until any other process read from the corresponding file in target directory or the block on the target directory is removed.

This patch only focus on the notification mechanism.
open-vm-tools/lib/include/vmblock.h
open-vm-tools/modules/shared/vmblock/block.c
open-vm-tools/modules/shared/vmblock/block.h
open-vm-tools/vmblock-fuse/fsops.c
open-vm-tools/vmblock-fuse/fsops.h