The acpi-erst backend for pstore device exposes a path in the
host accessible to the guest and as such we must set seclabels on
it to grant QEMU RW access.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
virSecurityDACRestoreFileLabel(mgr, def->os.slic_table) < 0)
rc = -1;
+ if (def->pstore &&
+ virSecurityDACRestoreFileLabel(mgr, def->pstore->path) < 0)
+ rc = -1;
+
return rc;
}
user, group, true) < 0)
return -1;
+ if (def->pstore &&
+ virSecurityDACSetOwnership(mgr, NULL,
+ def->pstore->path,
+ user, group, true) < 0)
+ return -1;
+
return 0;
}
virSecuritySELinuxRestoreFileLabel(mgr, def->os.slic_table, true) < 0)
rc = -1;
+ if (def->pstore &&
+ virSecuritySELinuxRestoreFileLabel(mgr, def->pstore->path, true) < 0)
+ rc = -1;
+
return rc;
}
data->content_context, true) < 0)
return -1;
+ if (def->pstore &&
+ virSecuritySELinuxSetFilecon(mgr, def->pstore->path,
+ data->content_context, true) < 0)
+ return -1;
+
return 0;
}
if (vah_add_file(&buf, ctl->def->os.slic_table, "r") != 0)
goto cleanup;
+ if (ctl->def->pstore)
+ if (vah_add_file(&buf, ctl->def->pstore->path, "rw") != 0)
+ goto cleanup;
+
if (ctl->def->os.loader && ctl->def->os.loader->path) {
bool readonly = false;
virTristateBoolToBool(ctl->def->os.loader->readonly, &readonly);