]> git.proxmox.com Git - mirror_qemu.git/commit
file-posix: Prepare permission code for fd switching
authorKevin Wolf <kwolf@redhat.com>
Fri, 8 Mar 2019 14:40:40 +0000 (15:40 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 12 Mar 2019 19:30:14 +0000 (20:30 +0100)
commit6ceabe6f77e4ae5ac2fa3d2ac1be11dc95021941
treea5885c3322e0bfe973c64fd5ff933f2d435ce1ca
parenta6aeca0ca530f104b5a5dd6704fca22b2c5edefa
file-posix: Prepare permission code for fd switching

In order to be able to dynamically reopen the file read-only or
read-write, depending on the users that are attached, we need to be able
to switch to a different file descriptor during the permission change.

This interacts with reopen, which also creates a new file descriptor and
performs permission changes internally. In this case, the permission
change code must reuse the reopen file descriptor instead of creating a
third one.

In turn, reopen can drop its code to copy file locks to the new file
descriptor because that is now done when applying the new permissions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/file-posix.c