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 <[email protected]>
---
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 <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dan Yasny <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to