security: Introduce virSecurityManagerGetDriver()

This function returns the name of the secdriver. Since the name
is invariant we don't really need to lock the manager - it won't
change.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Michal Privoznik 2019-09-11 11:40:04 +02:00
parent 81dbceea65
commit 3f968a8706
2 changed files with 8 additions and 0 deletions

View File

@ -332,6 +332,13 @@ virSecurityManagerGetVirtDriver(virSecurityManagerPtr mgr)
} }
const char *
virSecurityManagerGetDriver(virSecurityManagerPtr mgr)
{
return mgr->drv->name;
}
const char * const char *
virSecurityManagerGetDOI(virSecurityManagerPtr mgr) virSecurityManagerGetDOI(virSecurityManagerPtr mgr)
{ {

View File

@ -80,6 +80,7 @@ void virSecurityManagerTransactionAbort(virSecurityManagerPtr mgr);
void *virSecurityManagerGetPrivateData(virSecurityManagerPtr mgr); void *virSecurityManagerGetPrivateData(virSecurityManagerPtr mgr);
const char *virSecurityManagerGetDriver(virSecurityManagerPtr mgr);
const char *virSecurityManagerGetVirtDriver(virSecurityManagerPtr mgr); const char *virSecurityManagerGetVirtDriver(virSecurityManagerPtr mgr);
const char *virSecurityManagerGetDOI(virSecurityManagerPtr mgr); const char *virSecurityManagerGetDOI(virSecurityManagerPtr mgr);
const char *virSecurityManagerGetModel(virSecurityManagerPtr mgr); const char *virSecurityManagerGetModel(virSecurityManagerPtr mgr);