mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
0aad10cdae
This reverts commit 3e26b476b5
.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
43 lines
928 B
C
43 lines
928 B
C
#include <config.h>
|
|
|
|
#include <unistd.h>
|
|
#include "security/security_driver.h"
|
|
#include "virrandom.h"
|
|
#include "testutils.h"
|
|
|
|
static int
|
|
mymain(void)
|
|
{
|
|
virSecurityManagerPtr mgr;
|
|
const char *doi, *model;
|
|
|
|
if (virThreadInitialize() < 0)
|
|
return EXIT_FAILURE;
|
|
|
|
mgr = virSecurityManagerNew(NULL, "QEMU", VIR_SECURITY_MANAGER_DEFAULT_CONFINED);
|
|
if (mgr == NULL) {
|
|
fprintf(stderr, "Failed to start security driver");
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
model = virSecurityManagerGetModel(mgr);
|
|
if (!model) {
|
|
fprintf(stderr, "Failed to copy secModel model: %s",
|
|
strerror(errno));
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
doi = virSecurityManagerGetDOI(mgr);
|
|
if (!doi) {
|
|
fprintf(stderr, "Failed to copy secModel DOI: %s",
|
|
strerror(errno));
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
virObjectUnref(mgr);
|
|
|
|
return 0;
|
|
}
|
|
|
|
VIR_TEST_MAIN(mymain)
|