mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
apparmor: Fix build after split of disk source metadata
Commit 4f20226664b2d4d9e9496ec1e05c9280581a1ca0 breaks build with AppArmor enabled as it missed the refactor to the new accessors.
This commit is contained in:
parent
4f20226664
commit
ccef7d7876
@ -688,7 +688,7 @@ AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
virDomainDiskDefPtr disk)
|
||||
{
|
||||
if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
if (virDomainDiskGetType(disk) == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
return 0;
|
||||
|
||||
return reload_profile(mgr, def, NULL, false);
|
||||
@ -710,14 +710,16 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr,
|
||||
if (secdef->norelabel)
|
||||
return 0;
|
||||
|
||||
if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
if (!virDomainDiskGetSource(disk) ||
|
||||
virDomainDiskGetType(disk) == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
return 0;
|
||||
|
||||
if (secdef->imagelabel) {
|
||||
/* if the device doesn't exist, error out */
|
||||
if (!virFileExists(disk->src)) {
|
||||
if (!virFileExists(virDomainDiskGetSource(disk))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("\'%s\' does not exist"), disk->src);
|
||||
_("\'%s\' does not exist"),
|
||||
virDomainDiskGetSource(disk));
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -726,7 +728,8 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr,
|
||||
|
||||
/* update the profile only if it is loaded */
|
||||
if (profile_loaded(secdef->imagelabel) >= 0) {
|
||||
if (load_profile(mgr, secdef->imagelabel, def, disk->src,
|
||||
if (load_profile(mgr, secdef->imagelabel, def,
|
||||
virDomainDiskGetSource(disk),
|
||||
false) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot update AppArmor profile "
|
||||
|
@ -948,8 +948,8 @@ get_files(vahControl * ctl)
|
||||
*/
|
||||
if (!disk->backingChain) {
|
||||
bool probe = ctl->allowDiskFormatProbing;
|
||||
disk->backingChain = virStorageFileGetMetadata(disk->src,
|
||||
disk->format,
|
||||
disk->backingChain = virStorageFileGetMetadata(virDomainDiskGetSource(disk),
|
||||
virDomainDiskGetFormat(disk),
|
||||
-1, -1, probe);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user