f36d928 security: Manage SELinux labels on shared/readonly hostdev's

Authored and Committed by John Ferlan 9 years ago
    security: Manage SELinux labels on shared/readonly hostdev's
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1082521
    
    Support for shared hostdev's was added in a number of commits, initially
    starting with 'f2c1d9a80' and most recently commit id 'fd243fc4' to fix
    issues with the initial implementation.  Missed in all those changes was
    the need to mimic the virSELinux{Set|Restore}SecurityDiskLabel code to
    handle the "shared" (or shareable) and readonly options when Setting
    or Restoring the SELinux labels.
    
    This patch will adjust the virSecuritySELinuxSetSecuritySCSILabel to not
    use the virSecuritySELinuxSetSecurityHostdevLabelHelper in order to set
    the label. Rather follow what the Disk code does by setting the label
    differently based on whether shareable/readonly is set.  This patch will
    also modify the virSecuritySELinuxRestoreSecuritySCSILabel to follow
    the same logic as virSecuritySELinuxRestoreSecurityImageLabelInt and not
    restore the label if shared/readonly