From: Michal Privoznik <mprivozn(a)redhat.com>
In few instances, after
virDomainDefGetSecurityLabelDef(SECURITY_APPARMOR_NAME) was
called, we take the returned secdef and compare secdef->model
against SECURITY_APPARMOR_NAME. This makes no sense because
virDomainDefGetSecurityLabelDef() has already done this
comparison.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/security/security_apparmor.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 40907c9364..c7412a76c0 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -520,14 +520,6 @@ AppArmorSetSecurityProcessLabel(virSecurityManager *mgr
G_GNUC_UNUSED,
if ((profile_name = get_profile_name(def)) == NULL)
return -1;
- if (STRNEQ(SECURITY_APPARMOR_NAME, secdef->model)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("security label driver mismatch: \'%1$s\' model
configured for domain, but hypervisor driver is \'%2$s\'."),
- secdef->model, SECURITY_APPARMOR_NAME);
- if (use_apparmor() > 0)
- return -1;
- }
-
VIR_DEBUG("Changing AppArmor profile to %s", profile_name);
if (aa_change_profile(profile_name) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -557,14 +549,6 @@ AppArmorSetSecurityChildProcessLabel(virSecurityManager *mgr
G_GNUC_UNUSED,
if (!secdef || !secdef->label)
return 0;
- if (STRNEQ(SECURITY_APPARMOR_NAME, secdef->model)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("security label driver mismatch: \'%1$s\' model
configured for domain, but hypervisor driver is \'%2$s\'."),
- secdef->model, SECURITY_APPARMOR_NAME);
- if (use_apparmor() > 0)
- return -1;
- }
-
if ((profile_name = get_profile_name(def)) == NULL)
return -1;
--
2.49.1