Dan Kenigsberg has submitted this change and it was merged.
Change subject: sriov: Make the hook safe for concurrency ......................................................................
sriov: Make the hook safe for concurrency
The current model uses a cache that is not locked and could be overwritten by a second VM creation effectively preventing the return of the chown to root:root.
This patch solves that by creating with exclusivity a file for each virtual function that is attached (thus avoiding locking) but having concurrency safety due to the OS guarantee that the not more than a single processes can perform an open when the flags O_CREAT | O_EXCL are set.
Change-Id: I2c6ad7f2ee53911312700396000e0aca07a917e9 Signed-off-by: Antoni S. Puimedon asegurap@redhat.com --- M vdsm_hooks/sriov/after_vm_destroy.py M vdsm_hooks/sriov/before_vm_start.py 2 files changed, 40 insertions(+), 46 deletions(-)
Approvals: Antoni Segura Puimedon: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/13641 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I2c6ad7f2ee53911312700396000e0aca07a917e9 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Yasny dyasny@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server