95576b4 security driver: Introduce transaction APIs

Authored and Committed by mprivozn 7 years ago
    security driver: Introduce transaction APIs
    
    With our new qemu namespace code in place, the relabelling of
    devices is done not as good is it could: a child process is
    spawned, it enters the mount namespace of the qemu process and
    then runs desired API of the security driver.
    
    Problem with this approach is that internal state transition of
    the security driver done in the child process is not reflected in
    the parent process. While currently it wouldn't matter that much,
    it is fairly easy to forget about that. We should take the extra
    step now while this limitation is still fresh in our minds.
    
    Three new APIs are introduced here:
      virSecurityManagerTransactionStart()
      virSecurityManagerTransactionCommit()
      virSecurityManagerTransactionAbort()
    
    The Start() is going to be used to let security driver know that
    we are starting a new transaction. During a transaction no
    security labels are actually touched, but rather recorded and
    only at Commit() phase they are actually updated. Should
    something go wrong Abort() aborts the transaction freeing up all
    memory allocated by transaction.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    
        
file modified
+3 -0
file modified
+49 -0