mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
First thing, this patch introduces a new function to identify if a file descriptor is linked to any hard link on the system. This can let the VMM know if the file can be accessed by the user, or if the file will be destroyed as soon as the VMM releases the file descriptor. Based on this information, and associated with the knowledge about the region being MAP_SHARED or not, the VMM can now decide to skip the copy of the memory region content. If the user has access to the file from the filesystem, and if the file has been mapped as MAP_SHARED, we can consider the guest memory region content to be present in this file at any point in time. That's why in this specific case, there's no need for performing the copy of the memory region content into a dedicated file. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>