mirror of https://gitee.com/openkylin/libvirt.git
apparmor: don't overwrite error from reload_profile
Like other callers of reload_profile, don't overwrite errors in AppArmorSetSecurityHostdevLabelHelper.
This commit is contained in:
parent
598b6d7999
commit
5cdfc80ba8
|
@ -322,19 +322,7 @@ AppArmorSetSecurityHostdevLabelHelper(const char *file, void *opaque)
|
||||||
struct SDPDOP *ptr = opaque;
|
struct SDPDOP *ptr = opaque;
|
||||||
virDomainDefPtr def = ptr->def;
|
virDomainDefPtr def = ptr->def;
|
||||||
|
|
||||||
if (reload_profile(ptr->mgr, def, file, true) < 0) {
|
return reload_profile(ptr->mgr, def, file, true);
|
||||||
virSecurityLabelDefPtr secdef = virDomainDefGetSecurityLabelDef(
|
|
||||||
def, SECURITY_APPARMOR_NAME);
|
|
||||||
if (!secdef) {
|
|
||||||
virReportOOMError();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("cannot update AppArmor profile \'%s\'"),
|
|
||||||
secdef->imagelabel);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue